• Resolved Justin Tuijl

    (@static1635)


    Hi, to divide my site into different sections I use WP Categories and link to them. So each part is a different flavor of the website. Is there a way to apply a different footer to Category lists? For example the social media is different for each subject. Thanks

    • This topic was modified 10 months, 2 weeks ago by Justin Tuijl.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @static1635,

    Thank you for reaching out,
    You can set different footers in the pages, posts, etc, CPT(here: https://postimg.cc/WhSkd6tZ), but you cannot set the different footers for categories pages…

    The solution to achieve it is customization, and it needs familiarity with PHP, if you are unfamiliar with PHP, you can contact a PHP expert. To do this, first, you need to use the child theme. To do this you can create some footers in WP Dashboard > OceanWP > My Library: https://docs.oceanwp.org/article/600-how-to-create-a-custom-footer.

    Then in the root of the child theme, create a footer.php.
    Download the original and simple child theme: https://docs.oceanwp.org/article/90-sample-child-theme.

    Then go ahead and use the PHP like the following code:

    <?php
    if ( is_category( 'news' ) ) {
    	echo do_shortcode('[NEWS_FOOTER]');
    } elseif ( is_category( 'sports' ) ) {
    	echo do_shortcode('[SPORT_FOOTER]');	
    } else {	
    	echo do_shortcode('[DEFAULT_FOOTER]');
    }
    ?>
    
    <?php wp_footer(); ?>
    </body>
    </html>

    For instance, please check this screenshot: https://postimg.cc/8fJ07PmJ.

    Ensure the category names in the if statements match your actual category slugs. If needed, create additional elseif statements for other categories.
    Save the footer.php file.

    Important Considerations:
    1. This process requires a basic understanding of PHP code. If you’re not comfortable editing code, seek assistance from a developer.
    2. Always create a backup of your child theme before making customizations.
    3. Keep the code updated if you update OceanWP or WordPress.
    Alternative Solutions: If this method feels too technical, consider using plugins that offer more user-friendly ways to manage footers on category pages.

    I hope it helps.
    Best Regards

    Thread Starter Justin Tuijl

    (@static1635)

    Brilliant, thank you. Yes, I am experienced in PHP, Thanks for the tips, I like tinkering under the hood. The site mentioned is running a child theme.

    You’re most welcome.
    I’m glad we could help.

    Please let me know if you have any questions about the above steps.

    Thread Starter Justin Tuijl

    (@static1635)

    Actually, I should have said “footer widget area” rather than “footer”. I have copyright alone in the footer, universal across the website.

    Hello @static1635,

    It does not make a difference; you can create a general footer copyright section template and use it after the conditional footer.
    For instance, please take a look at this screenshot: https://postimg.cc/fk8Sj16L.

    Best Regards

    Thread Starter Justin Tuijl

    (@static1635)

    Ah! Yes, I see. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different footer on Category lists?’ is closed to new replies.