Site logo

Archived topic

Category link icon on custom post type

3 replies · Started by Matthew on March 25, 2019

Viewing posts 1–4 of 4

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!

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 :)

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,

Ah, try this function:

add_filter( 'generate_footer_meta_posts_types', function( $types ) {
    $types[] = 'pictures';

    return $types;
} );
This archived topic is closed to new replies.