Community Forums › Forums › Archived Forums › General Discussion › [post_comments] parameters are not working
Tagged: shortcode
- This topic has 4 replies, 2 voices, and was last updated 8 years, 4 months ago by
carasmo.
-
AuthorPosts
-
October 7, 2016 at 5:12 am #194326
outsidethebox
MemberHello,
I recently noticed that [post_comments] parameters are being ignored. I'm using Genesis 2.4.2 and eleven40 Pro Theme 2.0. $post_info is customized as follows, with [post_comments] according to the reference
add_filter( 'genesis_post_info', 'vad_post_info_filter' ); function vad_post_info_filter($post_info) { if ( is_single() ) { $post_info = '[post_categories] | Updated on: [genesis_modified_date] | [post_comments zero="Start discussion!" one="Comments: 1" more="Comments: %" hide_if_off="disabled"] [post_edit]'; } else { $post_info = '[post_categories] | [post_comments zero="Start Discussion!" one="Comments: 1" more="Comments: %" hide_if_off="disabled"] [post_edit]'; } return $post_info; }
Until recently the comment count was displayed as desired: Comments: N. Then it changed to comments N. I only updated Wordrpess in between, and updating Genesis to the latest version didn't change anything.
There's not much difference in display, but capitalization and ":" are missing. It doesn't look right, especially in Russian, which is the WordPress language. In general, the shortcode parameters are now ignored.
I'll appreciate any ideas on how to address the issue.
October 7, 2016 at 6:34 am #194332outsidethebox
MemberUpd (can't edit the original post). The question is specifically about the "more" parameter, because the other two work.
October 7, 2016 at 1:18 pm #194358carasmo
ParticipantThat is puzzling. I just tried it and it worked in the order you had it and the other way. Usually when weird stuff happens, I switch to the starter theme and paste that code into the functions.php there and then test, that way I can rule out where to look if it works there and not in my theme.
Also, I don't see where you are testing to see if the date is modified, my code looks like this:
function christina_post_info( $post_info ) { if ( get_the_modified_time() != get_the_time() ) { //* if the date is modified show last updated $post_meta = 'Updated on [post_modified_date]<span> · </span>Created on [post_date] by [post_author_posts_link] [post_comments] [post_edit]'; } else { //* original date $post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; } //* endif return $post_meta; } add_filter( 'genesis_post_info', 'christina_post_info' );
October 8, 2016 at 2:38 am #194373outsidethebox
Member@carasmo
Thanks for double-checking and confirming it works for you. Your code has the same issue with "more" on my site. What starter theme are you talking about?But still, I haven't made any changes to functions.php or Genesis, the issue just came out of the blue. As for modified date, I removed some code, because it was not the point.
October 8, 2016 at 8:20 am #194378carasmo
ParticipantThe starter theme that comes with Genesis framework. It's used by some developers as a starting point and I use it for debugging Genesis specific code.
I would test your site with the starter theme. It's not your child theme that has the shortcodes, it's the parent framework. If the same thing happens with the Starter theme, then it's probably a plugin. This is a guess.
I would turn on debugging in your wp-config.php.
Find:
define('WP_DEBUG', false);
change to :
define('WP_DEBUG', true);
Visit your site, what messages, if any, do you get?
Copy those down in some manner.
Turn off debugging.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.