[Support request] Please with adding some code to the theme

Home Forums Support Please with adding some code to the theme

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1171231
    Natalia

    Hello,

    I want to to use this plugin here
    https://github.com/billerickson/category-landing-page

    For 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
    natalia

    #1171245
    David
    Staff
    Customer Support

    Hi 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 hook

    4. Check Execute PHP

    5. Set your Display Rules to Category Archives

    #1171328
    Natalia

    Hello David,

    thanks for your answer. Sadly it does not work.

    #1171329
    Natalia

    Or 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?

    #1171616
    David
    Staff
    Customer Support

    Odd – 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/

    #1171634
    Natalia

    Ok thank you for your help!
    To that way you show…is it possible to use it with pagination?

    #1171635
    Natalia

    and this page https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/ redirects to some chinese or asian site?

    #1171708
    David
    Staff
    Customer Support

    If 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.

    #1171750
    Natalia

    Where 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/?

    #1171812
    David
    Staff
    Customer Support
    #1172224
    Natalia

    Hi 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?

    #1172226
    Natalia

    And what ist that Ajax Pagination that comes with PRO? Whats the difference between Ajax and normal pagination?

    #1172414
    David
    Staff
    Customer Support

    Can 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.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.