1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

get_header() not working on archive.php file

Discussion in 'Free Divi Community Forum' started by Ron Chio, Sep 25, 2020.

  1. Ron Chio

    Ron Chio New Member

    Relevant page: http://sarakahnnutrition.whitneybateson.com/tips/author/ronchio/

    Hi,

    I typically use get_header() within the archive.php file to include a custom divi module for archive pages, but it’s not working for some reason.

    These are the steps I’ve taken:

    1. I’ve created a Divi module with the custom header I want to include in my archive templates (this module is saved within my Divi library). The Divi module has a post ID of 275069 (see screenshot titled “SK - archive header”).

    2. Then I’ve included the following code in my archive.php file under my child theme:

    <?php get_header(); ?><?php get_header(); echo do_shortcode('[et_pb_section global_module="275069"][/et_pb_section]'); ?>

    Note I’ve added the Post ID 275069 within the code above (also see screenshot titled “Sk - archive”).

    3. When you go an archive page (for eg: http://sarakahnnutrition.whitneybateson.com/tips/author/ronchio/) the header does not show up (see screenshot titled “SK - no header”).

    Usually, this method works perfectly, but for some reason, it’s not working this time around.

    Any idea why it’s not working?

    I followed the exact same process for my search.php file and the header is working fine (for eg: http://sarakahnnutrition.whitneybateson.com/?s=test)

    Thanks!
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Login Customizer Plugin - Instantly beautify your Wordpress login page with 6 premade designs:Learn More
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    You should just use Divi Theme Builder to create your archive page with Divi Builder: https://www.elegantthemes.com/documentation/divi/the-divi-theme-builder/