Support » Themes and Templates » I have a custom page template and create a new custom footer, how do I edit code

  • Moneygod2015

    (@moneygod2015)


    Basically I want to use this specific footer (and edit it)
    I have a custom page template: announcement.php
    and I created a custom footer named: footer-custom.php

    1. How do I edit the code and on announcement.php so it used the custom footer I made: footer-custom.php file:
    i tried editing the index.php (but it didn’t work):

    <?php get_sidebar(); ?>
    if ( is_custom() ) :
    get_footer( ‘custom’ );
    else :
    get_footer();
    endif;
    ?>

    and also tried:
    <?php
    /*
    Template Name: Announcement
    */
    //Display the header
    get_header();
    //Display the page content/body
    if ( have_posts() ) while ( have_posts() )
    {
    the_post();
    the_content();
    }
    //Display the footer
    get_footer(custom);
    ?>

    But putting “custom” as the parameter cause the code to output: an invalid syntax

    2. The reason i need a custom footer because on the original page there was a button that just links to the top but now I want the footer in the page to be different since I want to the button to link to a webpage instead, as a CTA button:

    div class=”cta-button”>
    <p><?php the_field(‘cta_button_text’) ?></p>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I have a custom page template and create a new custom footer, how do I edit code’ is closed to new replies.