Site logo

Archived topic

Custom post type

18 replies · Started by _blank on August 30, 2017

Viewing posts 1–15 of 19

Hi

I got the snippet below from the forum sometime back. Just replace "kundcase" with your custom post type

//Add pagination to custom post type
add_action( 'generate_after_entry_content', 'jam_custom_post_type_post_nav' );
function jam_custom_post_type_post_nav() {
	if ( 'kundcase' == get_post_type() ) : ?>
		<footer class="entry-meta">
			<?php generate_entry_meta(); ?>
			<?php if ( is_single() ) generate_content_nav( 'nav-below' ); ?>
		</footer><!-- .entry-meta -->
	<?php endif;
}

Hey thanks Jamal, I'll give it a go.
Regards
Scott

Awesome that worked! Cheers Jamal.
Scott

Hi there,

Try this:

add_action( 'after_setup_theme', 'tu_remove_cpt_cats' );
function tu_remove_cpt_cats() {
    if ( 'your_post_type' == get_post_type() ) {
        add_filter( 'generate_show_categories', '__return_false' );
    }
}

Just update your_post_type to the name of your CPT :)

Hi Tom

Do I add this to snippets?

Thanks
Scott

Ah sorry, yes :)

Thanks Tom,

I've tried it here, but still have the "work" category.

http://be3.mackiedesigncompany.com/wp/work_slug/landmark-wholesale/

This is what I have in snippets.

add_action( 'after_setup_theme', 'tu_remove_cpt_cats' );
function tu_remove_cpt_cats() {
if ( 'work_slug' == get_post_type() ) {
add_filter( 'generate_show_categories', '__return_false' );
}
}

Thanks
Scott

Hmm.. Try switching after_setup_theme with wp.

Cool that worked.

What css class can I use to make the nav arrow and names bigger etc?

Thanks
Scott

Try Customizer > Typography > Primary Navigation.

Hi Leo

Thank you. That changes the main menu nav !

Scott

I'm not seeing Careway? Are you referring to the menu in the footer widgets?

This archived topic is closed to new replies.