• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Display content at archive page help please

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Display content at archive page help please

This topic is: resolved

Tagged: ACF, category archives, category pages

  • This topic has 11 replies, 2 voices, and was last updated 5 years, 10 months ago by wparrow.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • May 10, 2017 at 5:01 am #206238
    wparrow
    Member

    Hi,
    I am using Pods plugin to extend the content for archive page. I used the code below and insert to Simple Hooks at "genesis_after_loop" position.

    <div class="entry"><?php if (is_category()) {
    echo  do_shortcode('[pods name="category"]{@extra_content_for_category}[/pods]');
    }
    ?></div>

    The output is good but the problem is, the all extra content display at ALL categories.

    The correct is: Extra content of category A only display at bottom of category A (for example).

    I guest must have some condition of the code above to make it working correct with simple hooks

    Please help!
    Thanks

    May 10, 2017 at 3:34 pm #206257
    Brad Dalton
    Participant

    Try conditional tags


    Tutorials for StudioPress Themes.

    May 15, 2017 at 9:21 pm #206503
    Brad Dalton
    Participant

    Can't test this without installing Pods however this should work:

    add_action( 'genesis_entry_footer', 'print_pods' );
    
    function print_pods() {
    
    if ( is_category('a')) {
    echo  do_shortcode('[pods name="category"]{@extra_content_for_category}[/pods]');
    
        }
    
    }
    

    Where 1 is the i.d for your category. You can also use the category slug like this:

    add_action( 'genesis_entry_footer', 'print_pods' );
    
    function print_pods() {
    
    if ( is_category('news')) {
    echo  do_shortcode('[pods name="category"]{@extra_content_for_category}[/pods]');
    
        }
    
    }
    

    Where news is the category slug


    Tutorials for StudioPress Themes.

    May 16, 2017 at 12:16 am #206505
    wparrow
    Member

    Thanks Brad for answer, after I paid and join into your site.

    However, I want it dynamic works for all categories, not just one specific category.

    Could you help?

    Thanks

    May 16, 2017 at 12:24 am #206506
    Brad Dalton
    Participant

    Change the conditional tag to

    is_category()

    Note : I advise you not to use the Pods plugin as its not needed. If you want to use a plugin try ACF instead.


    Tutorials for StudioPress Themes.

    May 16, 2017 at 12:31 am #206507
    wparrow
    Member

    I used is_category() and it does not work, all Pods content display at all categories.

    Pods support very good by Jim and other authors. You can access via the Pods's forum on WordPress.org if needed.

    Thanks for your advice. I will try to use ACF now, never try before, hope it's easy

    May 16, 2017 at 12:32 am #206508
    Brad Dalton
    Participant

    Based on what you stated?

    However, I want it dynamic works for all categories, not just one specific category.


    Tutorials for StudioPress Themes.

    May 16, 2017 at 1:03 am #206509
    wparrow
    Member

    Please help create a sample on the given site as I gave you on FB chat. So, I can see how to do from your sample works.

    If it's easy and can do the job, we will replace Pods plugin by ACF

    Thanks

    May 16, 2017 at 1:36 am #206510
    Brad Dalton
    Participant

    Try this tutorial


    Tutorials for StudioPress Themes.

    May 16, 2017 at 3:17 am #206515
    wparrow
    Member

    Thanks, just applied your code to the site. But has one problem.

    Extra content display fine but it's also display at bottom of Recent posts widget on the sidebar.

    Please check this url https://www.canthoshopping.com/category/category-1/

    May 16, 2017 at 4:10 am #206517
    Brad Dalton
    Participant

    Updated code. Mark as resolved please.


    Tutorials for StudioPress Themes.

    May 16, 2017 at 4:27 am #206518
    wparrow
    Member

    Thanks for quick fix. Everything is ok now.

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Display content at archive page help please’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble