exs_entry_meta() not working in single_*.php
-
Hello,
I’ve been researching online and been trying to use exs_entry_meta( bool, bool, etc… ) to display author, date, categories, tags, comments which are controlled by bool(s).
The question I have is that when I apply this within modified child theme search.php or a category.php page exs_entry_meta() function outputs the bools I designated as ‘TRUE’ and null for the ones designated as ‘FALSE’ as it should.
However, when I attempted to use the same function, with essentially the same CPT structure and layout within a single_*.php page, nothing is output…
Things I’ve tried, non exhaustive list:
- adjusting the themes template-helpers.php exs_entry_meta() declaration to include, get_the_ID() as an argument, so that the ID may be manually passed through to the function, no output.
- Changing my foreach() loop to an if, while conditional loop statement where the other instances of exs_entry_meta() works, no output
- changing scope to: Global $post (and $wp_query), so that the foreach() loop has access to the $post->ID, no output
- I’ve taken the variable declarations from the search.php and category.php (limited declarations in category.php) to try to troubleshoot or identify what could possibly be wrong
- I’ve checked error_log, var_dump(), and print() to see if it would provide any clues. The clue I got was that the function (exs_entry_meta) is not receiving post->ID which is why it is returning ‘NULL’
- I’ve rewritten the function as a custom_entry_meta() function which declares all the meta data I am looking for, which does output metadata, however is missing icons and css styling already created for the actual exs_entry_meta() function, while also not being responsive when I turn “off” an argument.
function custom_entry_meta( $get_the_author = true | false, $get_the_category_list = true | false, $get_the_date = true | false, $get_the_tag_list = true | false, $get_comments_number = true | false ){ echo $get_the_author = get_avatar( get_the_author_meta( ‘ID’ ), $size = ’63’ ); echo $get_the_category_list = get_the_category_list(‘, ‘); echo $get_the_date = get_the_date(); echo $get_the_tag_list = get_the_tag_list(”, ‘, ‘); echo $get_comments_number = get_comments_number();}
I apologize in advance for the poor formatting, I am not too familiar with this format of posing a question, and I am unable to locate the “code” snippet tool here.
Any guidance or direction on how to get this function to work within a single_*.php structure would be great, I surmise I may be missing something with the scope or declaration of variables somewhere?
- The topic ‘exs_entry_meta() not working in single_*.php’ is closed to new replies.