Tagged: Blog, enfold, Latest News
-
AuthorPosts
-
February 4, 2015 at 7:28 pm #390876
ref: https://kriesi.at/support/topic/latest-blogs-function-php-code-displaying-the-fix/
GOAL: Get the blog post code you provided earlier to behave for a new content type as well.ISSUE:
For line:
if ( is_singular(‘post’) )
I want to add a new custom content type named wels-devotions which is a post with added fields. So I added it this way…
<?php add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( is_singular('post,wels-devotion') ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; } ?>
…and also tried
if ( is_singular('post,'wels-devotion') )
When I add the content type (both of these ways) neither work. Blogs-Latest-News static text still displays for my content type but perfectly for standard posts. I’m new to content types (wp-types plugin) – is there something I need to do to get Enfold theme to recognize it?
- This topic was modified 9 years, 10 months ago by welswebmaster. Reason: fix CODE
February 4, 2015 at 7:57 pm #390887I even tried this…
<?php add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( is_singular('post') || is_singular('wels-devotion') ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; } ?>
February 6, 2015 at 10:52 am #391898Hi!
Thank you for using Enfold.
Please try this:
if ( is_singular(array('post', 'wels-devotion')))
Best regards,
IsmaelFebruary 10, 2015 at 6:29 pm #393852This reply has been marked as private.February 11, 2015 at 11:29 am #394214Hi!
Alright. Please post the login details here so that we can check it.
Cheers!
IsmaelFebruary 11, 2015 at 4:32 pm #394430This reply has been marked as private.February 13, 2015 at 11:07 am #395578Hey!
The code we provided above works as expected. Please check it here: http://welstest.wpengine.com/wels-devotion/thursday-devotion-february-5/ (hosted on WPengine)
Regards,
IsmaelFebruary 13, 2015 at 3:12 pm #395782Awesome. Must be user error (that would be me). For the record, when I see an email from you guys, to me – its like a gift. Thanks so much for your support, Ismael.
-
AuthorPosts
- The topic ‘Add content type for Blogs-Latest-News override’ is closed to new replies.