[Support request] Category link icon on custom post type

Home Forums Support [Support request] Category link icon on custom post type

Home Forums Support Category link icon on custom post type

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #848943
    Matthew

    hello,

    Is the ‘Category’ folder icon link and the ‘< Previous, > Next post’ link at the bottom of a Post something I can activate with the theme or do I need to find some php on the net? This does appear for standard Posts but not my new custom posts I added.

    thanks!

    #849391
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s a font icon which displays when the cat-links class is used.

    <span class="cat-links">
        <a href="#">Category name</a>
    </span>

    Let me know if you need more info 🙂

    #849864
    Matthew

    Hi Tom,

    Thanks for the info,

    For my custom post type I copied single.php and content-single.php, renamed them and put them in the child theme folder i.e. single-pictures.php and content-pictures.php. Then I changed this code in single-pictures.php:

    get_template_part( 'content', 'single' ); to
    get_template_part( 'content', 'pictures' );

    From what I have read in other posts here this is correct? I am using the two files and calling one into the other.

    In both those template files there is no usage of the code you provided so I’m not sure how to actually get the before and after navigation to display.

    The below code in content-pictures.php is not working for the custom posts even though I have not changed any of the code for the two copied templates:

    wp_link_pages( array(
    	'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
    	'after'  => '</div>',
    ) );

    and neither is the Category and Tag links.
    I would like the custom posts to just pickup the functionality of the standard posts in this regard.

    Thanks,

    #850490
    Tom
    Lead Developer
    Lead Developer

    Ah, try this function:

    add_filter( 'generate_footer_meta_posts_types', function( $types ) {
        $types[] = 'pictures';
    
        return $types;
    } );
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.