Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to display fields #99

Closed
webiworld opened this issue Jan 8, 2015 · 1 comment
Closed

Not able to display fields #99

webiworld opened this issue Jan 8, 2015 · 1 comment

Comments

@webiworld
Copy link

Hi

Your plugin is very useful, As I have seen comments. But I am not able to print the custom fields on my custom template page. I know it will be a silly mistake. But not able to figure it out from last 3 hours.

What I trying to achieve is on parent category page, I want to show child categories with image.

Here is my category.php

category_parent != 0) { //Loop to show post, If category has parent } else { // Display sub categories with images only $args = array( 'orderby' => 'id', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 0, 'child_of' => $parent_cat_id ); $categories= get_categories($args); foreach( $categories as $category) { $saved_data = get_tax_meta($category->term_id,'text_field_id'); echo $saved_data; $saved_data1 = get_tax_meta($category->term_id,'image_field_id',true); echo '

'; $link = get_category_link( $parent_cat_id ).$category->slug; echo "".$category->name.""; } } ?>

Note - on print_r($category)
I get this result -

stdClass Object ( [term_id] => 2 [name] => Accounts [slug] => accounts [term_group] => 0 [term_taxonomy_id] => 2 [taxonomy] => category [description] => This is a account book description [parent] => 1 [count] => 1 [cat_ID] => 2 [category_count] => 1 [category_description] => This is a account book description [cat_name] => Accounts [category_nicename] => accounts [category_parent] => 1 ) 

Is I am doing wrong ? Nothing is showing on screen, whatever I added to new custom fields.

I check the value for $saved_data, but it is blank and $saved_data1 is giving the error - Illegal string offset 'src'

Any help or hint ?
@bainternet
Copy link
Owner

src was changed with url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants