- This topic has 10 replies, 3 voices, and was last updated 2 years, 6 months ago by David.
-
AuthorPosts
-
September 21, 2021 at 3:40 pm #1938476Oladipo
Hello GeneratePress,
Thanks for the amazing theme. Please I created a custom post type and assigned the core WP tags to the post type. Now, I activated blog columns on the generate press settings and thanks I was able to display the column on the post types archive pages and custom taxonomy .
The issue I am having now is this; when I view tags assigned to traditional posts, the column works, but when I view tags which contains the custom post types, the columns refuse to work and only displays in a single column.
Please how can I resolve this?
Thanks.
September 21, 2021 at 3:52 pm #1938485OladipoPlease I would also love to display text at the end of every tag, category and custom taxonomy page. The text I want to display is unique to each term on the taxonomy, I would like to display the text immediately after the pagination how can I achieve this too?
Thanks
September 21, 2021 at 6:32 pm #1938543ElvinStaffCustomer SupportHi there,
You’ll need a PHP snippet to enable the columns for custom post type.
Here’s the code snippet you’ll need – https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type
Please I would also love to display text at the end of every tag, category and custom taxonomy page. The text I want to display is unique to each term on the taxonomy, I would like to display the text immediately after the pagination how can I achieve this too?
It depends on where the text will come from. Is it going to be dynamic coming from a custom field? Can you explain a bit more?
September 21, 2021 at 10:50 pm #1938668OladipoThank you for your response.
I have seen this guide and I used it to make the Columns appear on the custom post type archive page. Now I need to make the tags archive display the columns and custom post type, please how can I achieve this?
For the text on the tag page, I want to place a box like the description box that will on every tag term and allow you add content into it, then this content will be displayed on the end of content, just the description of the tag appears before the content.
September 21, 2021 at 11:05 pm #1938676ElvinStaffCustomer SupportI have seen this guide and I used it to make the Columns appear on the custom post type archive page. Now I need to make the tags archive display the columns and custom post type, please how can I achieve this?
Does the custom post type share the same “Tags” taxonomy the default post type uses? IF yes, then these CPTs should automatically show up on the archive page of the default “Tags” terms.
If the custom post type has its own custom taxonomy “Tags”, this custom taxonomy “Tags” associated to the CPT will have its own archive page.
Now if you have 2 “Tags” taxonomy between the default post type and your custom post type, you may have to do a
pre_get_posts
filter to add the query for the custom taxonomy “Tags” to the default taxonomy “Tags”.But if you’re simply trying to add columns to the default taxonomies that come with WordPress, this option should be enough – https://docs.generatepress.com/article/using-columns-in-the-blog/
We only use the PHP snippet so the Customizer settings apply to the custom post type. 😀
For the text on the tag page, I want to place a box like the description box that will on every tag term and allow you add content into it, then this content will be displayed on the end of content, just the description of the tag appears before the content.
Not exactly sure what you mean. Are you trying replace the default tag term description to a dynamic text value? If yes, can you specify where the dynamic text value will come from? Do you have a custom field assigned to the tag terms?
Let us know. 🙂
September 22, 2021 at 12:25 am #1938720OladipoDoes the custom post type share the same “Tags” taxonomy the default post type uses? IF yes, then these CPTs should automatically show up on the archive page of the default “Tags” terms.
Yes, the CPT shares the default Tags which post uses, but it is not displaying the column grid. This is the code I used to connect the CPT to the tags
add_filter( 'pre_get_posts', 'cll_add_custom_types' ); function cll_add_custom_types( $query ) { if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] )) { $query->set( 'post_type', array( 'post', 'books', 'ebooks', 'audiobooks') ); return $query; } }
I want to add a box like the description box to the tag terms and display that box after the tag content(i.e. posts), while the description box appears at the top by default, the box will appear underneath, after the posts.
Thanks.
September 22, 2021 at 12:46 am #1938738ElvinStaffCustomer SupportCan you share the filter conditions you’re using for
generate_blog_columns
?Something like this should be enough.
add_filter( 'generate_blog_columns','tu_portfolio_columns' ); function tu_portfolio_columns( $columns ) { if ( is_post_type_archive( array( 'post', 'books', 'ebooks', 'audiobooks') ) || is_category() || is_tag() ) { return true; } return $columns; }
I want to add a box like the description box to the tag terms and display that box after the tag content(i.e. posts), while the description box appears at the top by default, the box will appear underneath, after the posts.
The appropriate hook to use for this is
generate_after_loop
. You can hook the description box you’ve created on this hook. It’ll appear after the post loop. Just make sure the display rule location for the block or hook element you’ve created the description box on is correct. 🙂September 22, 2021 at 5:54 am #1939017OladipoWOW! It worked perfectly.
Thank you.
Also, please how can I create the the description box?
Thanks so much
September 22, 2021 at 6:41 am #1939056DavidStaffCustomer SupportHi there,
you can use a Block Element:
https://docs.generatepress.com/article/block-element-overview/
Add a GenerateBlocks Container Block, which you can use to style and set the contents typography.
Then inside the Container Block add a GP Dynamic Content Block:
https://docs.generatepress.com/article/dynamic-blocks/#dynamic-content
And set it to Term Description.
You can then set the Block – Hook to
after_main_content
and its Display Rules to the Archives you want the term description displayed onSeptember 22, 2021 at 10:43 am #1939512OladipoThanks so much for the amazing support.
God bless you guys!
September 23, 2021 at 2:53 am #1940058DavidStaffCustomer SupportGlad we could be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.