• Resolved scotty2223

    (@scotty2223)


    Hi I am using your plugin to show related blog posts on my blog.
    Is there any way to show the blog categories with links in the display as well… The Author shows up – but I do not see a setting to get the categories to display?
    Let me know.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Ajay

    (@ajay)

    Hi, sorry for the delayed response. You can’t do this directly via the settings but you could do it with a code snippet. Are you comfortable adding a code snippet to your site?

    Thread Starter scotty2223

    (@scotty2223)

    Thank you for the response.

    If you could let me know the snippet I can add this…. Thank you so much,

    Plugin Author Ajay

    (@ajay)

    Try this:

    function crp_list_cats( $output, $result, $args ) {
    	$categories = get_the_category_list( ', ', '', $result->ID );
    
    	$output .= ' ' . $categories;
    
    	return $output;
    }
    add_filter( 'crp_after_list_item', 'crp_list_cats', 10, 3 );
    Thread Starter scotty2223

    (@scotty2223)

    Thanks for the response – but the function is not returning anything.

    Plugin Author Ajay

    (@ajay)

    Where are you adding this in? Are you seeing the regular related posts but not the categories included?

    Thread Starter scotty2223

    (@scotty2223)

    I added to the functions file..
    The related posts are showing as normally… but not listing the category under the title… by the by line

    Plugin Author Ajay

    (@ajay)

    Would you be able to try this with the code snippets plugin?

    https://www.ads-software.com/plugins/code-snippets/

    Plugin Author Ajay

    (@ajay)

    Also, you will need to clear the plugin’s cache under Tools > Related Posts Tools

    Thread Starter scotty2223

    (@scotty2223)

    This worked – is there anyway to have it display under the post title?
    right now it is being inserted after the closing li crp_related li </li> tag of the post block…

    Let me know – much appreciated!

    Plugin Author Ajay

    (@ajay)

    Not easily with a filter because it’s then in the middle of the content.

    My pro version, which will be out soon, includes a custom block that allows you to select whatever content you need similar to the Query Block or choose from ready templates.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Include Categories in display’ is closed to new replies.