- This topic has 12 replies, 2 voices, and was last updated 4 years, 1 month ago by David.
-
AuthorPosts
-
February 20, 2020 at 2:59 am #1171231Natalia
Hello,
I want to to use this plugin here
https://github.com/billerickson/category-landing-pageFor creating Categorie Landing Pages.
In the explanation of the plugin it says:
“You’ll need to do a bit of coding to get the landing page content to appear on your category archive pages. Every theme is different so I recommend you talk to your theme developer for guidance on how to add this.Add the following code where you would like the landing page content to appear:
if( function_exists( ‘category_landing_page’ ) )
category_landing_page()->show();”So, I am not sure, where to add this on generate press. Can you please help me here?
Thank you
nataliaFebruary 20, 2020 at 3:12 am #1171245DavidStaffCustomer SupportHi there,
try this:
1. Create a new Hook Element
https://docs.generatepress.com/article/hooks-element-overview/2. Add this code:
<?php if( function_exists( 'category_landing_page' ) ) category_landing_page()->show(); ?>
3. Select the
before_main_content
hook4. Check Execute PHP
5. Set your Display Rules to Category Archives
February 20, 2020 at 4:56 am #1171328NataliaHello David,
thanks for your answer. Sadly it does not work.
February 20, 2020 at 5:02 am #1171329NataliaOr maybe you have another solution as this plugin? I need to design the archives like normal page with gutenberg.
I know I could create a page called “pasta recipes” and a categorie named the same and then redirect the categorie archive to the specific page that I could fill with my content. But then I do have another issue because I cannot find a way to not just the latest posts but the real archive loop post with all posts from that category with pagination.Maybe you know how can I solve this? Or can I maybe create a category-archive-loop that I include on a normal page but has that archive pagination behaviour like categorie archives?
February 20, 2020 at 6:53 am #1171616DavidStaffCustomer SupportOdd – i think it may need to be inside the loop – ill do some tests.
Alternatively we provide this method for using the WP Show Posts plugin to create your own ‘archives’https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/
Adding that function: https://docs.generatepress.com/article/adding-php/
February 20, 2020 at 7:06 am #1171634NataliaOk thank you for your help!
To that way you show…is it possible to use it with pagination?February 20, 2020 at 7:07 am #1171635Nataliaand this page https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/ redirects to some chinese or asian site?
February 20, 2020 at 8:09 am #1171708DavidStaffCustomer SupportIf you use the WP Show Posts Plugin to display the list – you can include Pagination on one list.
I am not sure what you mean by the redirect ? Are you saying that link takes you elsewhere let me know.
February 20, 2020 at 8:51 am #1171750NataliaWhere would I add this here:
To do this, you need to add this function to your site.
add_filter(‘request’, function( array $query_vars ) {
if ( is_admin() ) {
return $query_vars;
}if ( isset( $query_vars[‘category_name’] ) ) {
$pagename = $query_vars[‘category_name’];$query_vars = array( ‘pagename’ => “$pagename” );
}return $query_vars;
} );
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/?February 20, 2020 at 9:47 am #1171812DavidStaffCustomer SupportThis document explains how to add thee code:
February 20, 2020 at 11:03 pm #1172224NataliaHi David,
ok I added the php code and installed the WP Show Post Plugin, but I see this checkbox : Seitennavigation
Die Seitennavigation sollte nur genutzt werden, wenn deine Beiträge das Einzige im Inhaltsbereich sind, um Probleme mit doppeltem Inhalt zu vermeiden. (its german)So my question is? Isnt it possible to use pagination due to the double content issue?
February 20, 2020 at 11:10 pm #1172226NataliaAnd what ist that Ajax Pagination that comes with PRO? Whats the difference between Ajax and normal pagination?
February 21, 2020 at 4:24 am #1172414DavidStaffCustomer SupportCan i ask – what type of content are you wanting to add to the Archives ? And will it be consistent across the archives – can you share an example?
There may be a better solution.
-
AuthorPosts
- You must be logged in to reply to this topic.