Site logo

Archived topic

Specific display for custom taxonomie

12 replies · Started by Thierry on November 8, 2016

Viewing posts 1–13 of 13

Hello,

I use this plugin : https://wordpress.org/plugins/custom-post-type-ui/

For a specific taxonomies i want display (or not display) the elements (sidebar, read more)

I think make a copy og archives.php but after ? what is the process ?

Thx

Great and for customize this page how i can di this ?

You would just take the copied file, rename it and then add your customizations to the code.

Hi, ok but where i can found an exemple for i understand the customisation of this specific file ?

thank you so much

I begin to understand but I need help.

I copy content.php and i create content-news.php for a specific layout, if i want 2 sidebar whow i can code this ?

Sidebar layouts can be altered using a filter: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter

So if your custom post type is named "news", you could do something like this:

add_filter( 'generate_sidebar_layout','generate_cpt_sidebar_layout' );
function generate_cpt_sidebar_layout( $layout )
{
 	// If we are on a woocommerce page, set the sidebar
 	if ( 'news' == get_post_type() )
 	 	return 'both-left';

 	// Or else, set the regular layout
 	return $layout;
 }

ok Tom, step by step i I advance and now my problem is displaying ACF field in the sidebar for the single page. You think a solution ?

If you want it in a widget, you'll need to make a shortcode with your ACF field.

Might be worth asking them what the best way is.

simply, great :)

thank you Tom, last thing if i want modify a sidebar only with code, it's possible ?

Yes i think that's ok, thx Tom :)

You're welcome :)

This archived topic is closed to new replies.