• I am trying to duplicate the php for frontpage template so I can use on a new page. But I only want the contact form & our focus to appear. I then plan to use SOtext edit to add the main content – Will need to put some sort of code in PHP I guess. I am currently not at my own computer (otherwise would try it out myself), but hoping someone with knowledge would be kind enough to check over this coding. I am happy to mess about with wordpress, but have little understanding of what all the code bits do.

    <?php
    /**
    * Template Name: Frontpage
    *
    * @package zerif-lite
    */
    get_header();

    ?>

    </header> <!– / END HOME SECTION –>

    <?php zerif_after_header_trigger(); ?>
    <div id=”content” class=”site-content”>

    [HOPING TO PUT SOMEtHING IN HERE THAT ALLOWS TEXT ON WEBSITE TO BE CHANGED VIA SO TEXT EDItOR]

    <?php

    /* OUR FOCUS SECTION */

    $zerif_ourfocus_show = get_theme_mod( ‘zerif_ourfocus_show’ );

    if ( ( isset( $zerif_ourfocus_show ) && $zerif_ourfocus_show != 1 ) || is_customize_preview() ) {

    get_template_part( ‘sections/our_focus’ );

    }

    /* CONTACT US */
    $zerif_contactus_show = get_theme_mod( ‘zerif_contactus_show’ );

    if ( ( isset( $zerif_contactus_show ) && $zerif_contactus_show != 1 ) || is_customize_preview() ) :
    echo ‘<section class=”contact-us ‘ . ( ( is_customize_preview() && ( ! isset( $zerif_contactus_show ) || $zerif_contactus_show == 1 ) ) ? ‘ zerif_hidden_if_not_customizer ‘ : ” ) . ‘” id=”contact”>’;
    ?>
    <div class=”container”>
    <!– SECTION HEADER –>
    <div class=”section-header”>

    <?php

    if ( current_user_can( ‘edit_theme_options’ ) ) {
    $zerif_contactus_title = get_theme_mod( ‘zerif_contactus_title’, sprintf( ‘%2$s‘, esc_url( admin_url( ‘customize.php?autofocus[control]=zerif_contactus_title’ ) ), __( ‘Get in touch’, ‘zerif-lite’ ) ) );
    } else {
    $zerif_contactus_title = get_theme_mod( ‘zerif_contactus_title’ );
    }
    if ( ! empty( $zerif_contactus_title ) ) :
    echo ‘<h2 class=”white-text”>’ . wp_kses_post( $zerif_contactus_title ) . ‘</h2>’;
    elseif ( is_customize_preview() ) :
    echo ‘<h2 class=”white-text zerif_hidden_if_not_customizer”></h2>’;
    endif;

    $contactus_subtitle_default = ”;
    if ( ! defined( ‘PIRATE_FORMS_VERSION’ ) ) {
    /* translators: Pirate Forms plugin install link */
    $contactus_subtitle_default = sprintf( __( ‘You need to install %s to create a contact form.’, ‘zerif-lite’ ), sprintf( ‘%2$s‘, esc_url( wp_nonce_url( self_admin_url( ‘update.php?action=install-plugin&plugin=pirate-forms’ ), ‘install-plugin_pirate-forms’ ) ), ‘Pirate Forms’ ) );
    }

    if ( current_user_can( ‘edit_theme_options’ ) ) {
    $zerif_contactus_subtitle = get_theme_mod( ‘zerif_contactus_subtitle’, $contactus_subtitle_default );
    } else {
    $zerif_contactus_subtitle = get_theme_mod( ‘zerif_contactus_subtitle’ );
    }

    if ( ! empty( $zerif_contactus_subtitle ) ) {
    echo ‘<div class=”white-text section-legend”>’ . wp_kses_post( $zerif_contactus_subtitle ) . ‘</div>’;
    } elseif ( is_customize_preview() ) {
    echo ‘<h6 class=”white-text section-legend zerif_hidden_if_not_customizer”></h6>’;
    }
    ?>
    </div>
    <!– / END SECTION HEADER –>

    <?php
    if ( defined( ‘PIRATE_FORMS_VERSION’ ) && shortcode_exists( ‘pirate_forms’ ) ) :

    echo ‘<div class=”row”>’;
    echo do_shortcode( ‘[pirate_forms]’ );
    echo ‘</div>’;

    endif;
    ?>

    </div> <!– / END CONTAINER –>

    </section> <!– / END CONTACT US SECTION–>
    <?php
    endif;

    get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you have any luck on this? I would like to see about adding a page but keeping the big title, menu and footer style the same.

    Hello, for such customizations to the theme we recommend seeking aid from a freelancer

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Duplicate template-frontpage php’ is closed to new replies.