juniojeff
Forum Replies Created
-
Hey!
Thanks for replying! I actually resolved the issue by just getting rid of some lines of the code:function primary_category_shortcode(){ $term = null; $termName = null; $term = the_seo_framework()->get_primary_term( $post->ID, 'category' ); if ( empty( $term ) ) { $terms = get_the_terms( $post->ID, 'category' ); if ( ! empty( $terms ) ) { $term = $terms[0]->term_id; } } $termName = get_cat_name($term); return $termName; }
This code works on most of my posts, but for some reason, certain categories result in no ID being passed on to $term. Because of the way the code is set up, it spits out the parent category ID (the if then statement), but if I get rid of the if then statement, it does not return any ID value into $term. I have double and tripled check that the primary category is set correctly to the child category.
Again this code works for 75% of my categories (they’re all child categories under a parent category that is NOT the primary category), but only doesn’t work for roughly 25% of my categories…with no other differences that I can see
Any thoughts?
Forum: Plugins
In reply to: [Contextual Related Posts] Add Category to OutputThanks for your reply Ajay. There is a weird behavior when I use that – it creates a link to the category but then makes the title of the post into plain text.
ANYWAYS…something, maybe a little simpler and actually even more important. When I use [crp limit=”1″ show_author=”1″], it shows the title and “by XXX”. Is there a way to remove the link to the author?
Thanks so much Ajay
Forum: Plugins
In reply to: [Contextual Related Posts] Sidebar Widget Auto Turns on Show Excerpts…Great! The customizer worked, thanks Ajay