0

Hi,

Here http://meganrapinoe.com.php53-9.dfw1-1.websitetestlink.com/ the WordPress site. I am using an elegant theme 'Styleshop'. I want to make the update page http://meganrapinoe.com.php53-9.dfw1-1.websitetestlink.com/updates/ same as the home page without the slider and three box under slider. So, I put the header, post, sidebar,footer code in the update template from home.php but the update page looks strange. Hope somebody can help me.

Here is the home.php

<?php get_header(); ?>

<?php if ( 'on' == et_get_option( 'styleshop_featured', 'on' ) && is_home() ) get_template_part( 'includes/featured', 'home' ); ?>

<?php if ( 'on' == et_get_option( 'styleshop_display_offers', 'on' ) ) : ?>
<?php
    $args = array(
        'post_type'         => 'offer',
        'posts_per_page'    => (int) et_get_option( 'styleshop_home_offers_number', 6 )
    );
    $et_offers_query = new WP_Query( apply_filters( 'et_home_offers_query_args', $args ) );
    if ( $et_offers_query->have_posts() ) : ?>






    <section id="special-offers">
        <h1><?php esc_html_e( '', 'StyleShop' ); ?></h1>
        <div id="offers">
            <div class="et-carousel-wrapper">
                <ul class="clearfix offer_ul">
                <?php while ( $et_offers_query->have_posts() ) : $et_offers_query->the_post(); ?>
                <?php
                    $thumb = '';
                    $width = 455;
                    $height = 275;
                    $classtext = '';
                    $titletext = get_the_title();
                    $thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'Offer' );
                    $thumb = $thumbnail["thumb"];

                    $custom_permalink   = ( $et_custom_permalink = get_post_meta( get_the_ID(), '_et_offer_custom_link', true ) ) && '' != $et_custom_permalink ? $et_custom_permalink : '#';
                    $custom_button      = ( $et_custom_button = get_post_meta( get_the_ID(), '_et_offer_button_text', true ) ) && '' != $et_custom_button ? $et_custom_button : __( 'Read More', 'StyleShop' );
                ?>
                    <li class="offer_li">
                        <?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext ); ?>
                        <span class="overlay"></span>
                        <div class="offers-description">
                            <h2><a href="<?php echo esc_url( $custom_permalink ); ?>"><?php the_title(); ?></a></h2>
                            <a href="<?php echo esc_url( $custom_permalink ); ?>" class="more-button small"><?php echo esc_html( $custom_button ); ?></a>
                        </div>
                    </li>
                <?php endwhile; ?>
                </ul>
            </div> <!-- .et-carousel-wrapper -->
        </div>
    </section> <!-- #special-offers -->


<section class="home-new-offer">

    <div class="new-offer-div">

<img src="/wp-content/uploads/2013/11/homebox3.jpg" alt="homebox3" class="alignnone size-full wp-image-36" style="width: 90%; height: auto;border: 1px solid #000;" />
<div class="more-button small" style="margin-top: -18px;">INSIDE MY HEAD</div>
    </div>


    <div class="new-offer-div">

<img src="/wp-content/uploads/2013/11/homebox1.jpg" alt="homebox1" width="417" height="278" class="alignnone size-full wp-image-32" style="width: 90%; height: auto;border: 1px solid #000;" />
<div class="more-button small" style="margin-top: -18px;">FASHION</div>
    </div>


    <div class="new-offer-div">

<img src="/wp-content/uploads/2013/11/homebox2.jpg" alt="homebox2" width="417" height="278" class="alignnone size-full wp-image-35" style="width: 90%; height: auto;border: 1px solid #000;" />

<div class="more-button small" style="margin-top: -18px;">REGISTER NOW</div>

    </div>


</section>



<?php
    endif;
    wp_reset_postdata();
?>
<?php endif; // 'on' == et_get_option( 'styleshop_display_offers', 'on' ) ?>


<?php if ( 'on' == et_get_option( 'styleshop_home_products_onsale', 'on' ) && class_exists( 'woocommerce' ) ) : ?>
<?php
    global $woocommerce;

    $product_ids_on_sale = et_woocommerce_get_product_on_sale_ids();

    $meta_query[] = $woocommerce->query->visibility_meta_query();
    $meta_query[] = $woocommerce->query->stock_status_meta_query();

    $query_args = array(
        'posts_per_page' => (int) et_get_option( 'styleshop_sale_products_number', 8 ),
        'no_found_rows' => 1,
        'post_status'   => 'publish',
        'post_type'     => 'product',
        'orderby'       => 'date',
        'order'         => 'DESC',
        'meta_query'    => $meta_query,
        'post__in'      => $product_ids_on_sale
    );

    $et_products_onsale_query = new WP_Query( $query_args );

    if ( $et_products_onsale_query->have_posts() ) :
?>
    <section class="home-area">
        <h1><?php esc_html_e( 'Featured Products Now On Sale!', 'StyleShop' ); ?></h1>
        <ul class="et-products clearfix">
        <?php while ( $et_products_onsale_query->have_posts() ) : $et_products_onsale_query->the_post(); ?>
            <li>
            <?php
                global $post;
                $_product = &new WC_Product( $et_products_onsale_query->post->ID );

                $thumb = '';
                $width = 140;
                $height = 135;
                $classtext = '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'ProductImage' );
                $thumb = $thumbnail["thumb"];
            ?>
                    <a href="<?php the_permalink(); ?>">
                        <?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext ); ?>
                    </a>
                    <?php woocommerce_show_product_sale_flash( $post, $_product ); ?>
                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                    <span class="et-price-button">
                        <span class="et-price-before"><del><?php echo woocommerce_price( $_product->regular_price ); ?></del></span>
                        <span class="et-price-sale"><?php echo woocommerce_price( $_product->get_price() ); ?></span>
                    </span>
                </a>
            </li>
        <?php endwhile; ?>
        </ul>
    </section>
<?php
    endif;
    wp_reset_postdata();
?>
<?php endif; // 'on' == et_get_option( 'styleshop_home_products_onsale', 'on' ) ?>

<?php if ( 'on' == et_get_option( 'styleshop_home_new_items', 'on' ) && class_exists( 'woocommerce' ) && 'false' == et_get_option( 'styleshop_blog_style', 'false' ) ) : ?>
    <?php if ( have_posts() ) : ?>
    <section class="home-area">
        <h1><?php esc_html_e( 'Hot New Items', 'StyleShop' ); ?></h1>
        <ul class="et-products clearfix">
        <?php while ( have_posts() ) : the_post(); ?>
            <li>
            <?php
                global $post;
                $_product = &new WC_Product( $post->ID );

                $thumb = '';
                $width = 140;
                $height = 135;
                $classtext = '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'ProductImage' );
                $thumb = $thumbnail["thumb"];
            ?>
                <a href="<?php the_permalink(); ?>">
                    <?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext ); ?>
                </a>
                <?php woocommerce_show_product_sale_flash( $post, $_product ); ?>
                <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

            <?php $product_ids_on_sale = et_woocommerce_get_product_on_sale_ids(); ?>
            <?php if ( ! in_array( get_the_ID(), array_map( 'intval', $product_ids_on_sale ) ) ) { ?>
                <?php if ( '' != $_product->get_price_html() ) : ?>
                <span class="et-main-price"><?php echo $_product->get_price_html(); ?></span>
                <?php endif; ?>
            <?php } else { ?>
                <span class="et-price-button">
                    <span class="et-price-before"><del><?php echo woocommerce_price( $_product->regular_price ); ?></del></span>
                    <span class="et-price-sale"><?php echo woocommerce_price( $_product->get_price() ); ?></span>
                </span>
            <?php } ?>

            </li>
        <?php endwhile; ?>
        </ul>
    </section>
    <?php endif; ?>
<?php endif; // 'on' == et_get_option( 'styleshop_home_new_items', 'on' ) ?>

<?php if ( 'on' == et_get_option( 'styleshop_show_logos', 'false' ) ) { ?>
    <section class="home-area">
        <h1><?php esc_html_e( '', 'StyleShop' ); ?></h1>
        <ul id="client-logos" class="clearfix">
    <?php
        $logos_number = (int) apply_filters( 'et_logos_number', 4 );

        for ( $i = 1; $i <= $logos_number; $i++ ) {
            if ( ( $logo_path = et_get_option( 'styleshop_logo_path_' . $i ) ) && '' != $logo_path )
                printf( '<li><a href="%s"><img src="%s" alt="%s"/></a></li>',
                    esc_url( et_get_option( 'styleshop_logo_url_' . $i, '#' ) ),
                    esc_attr( $logo_path ),
                    esc_attr( et_get_option( 'styleshop_logo_alt_' . $i, '' ) )
                );
        }
    ?>
        </ul>
    </section>
<?php } // 'on' == et_get_option( 'styleshop_show_logos', 'false' ?>
<?php 
global $wp_query;
query_posts(array_merge($wp_query->query, array(
    'paged'          => 1,
    'posts_per_page' => 3
)));
?>
<?php if ( 'on' == et_get_option( 'styleshop_blog_style', 'false' ) ) { ?>
    <div id="content-area" class="clearfix">
        <div id="main-area">
            <div id="articles">
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                <?php get_template_part('includes/entry', 'index'); ?>
            <?php
            endwhile;

                // if ( function_exists( 'wp_pagenavi' ) ) wp_pagenavi();
                // else get_template_part( 'includes/navigation', 'entry' );
            else:
                get_template_part( 'includes/no-results', 'entry' );
            endif; ?>
            </div>
            <div style="padding: 30px;float: right;">
            <?php if(function_exists('ajax_paging_more_post')) ajax_paging_more_post('More News +'); ?>
            </div>
        </div> <!-- #main-area -->

        <?php get_sidebar(); ?>
    </div> <!-- #content-area -->
<?php } // 'on' == et_get_option( 'styleshop_blog_style', 'false' ) ?>

<?php get_footer(); ?>

Here is the code for update template new-template.php

<?php
/**
*
*Template Name: home-blog-new
*
*/
?>

<?php get_header(); ?>




    <div id="content-area" class="clearfix">
        <div id="main-area">
            <div id="articles">
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                <?php get_template_part('includes/entry', 'index'); ?>
            <?php
            endwhile;

                // if ( function_exists( 'wp_pagenavi' ) ) wp_pagenavi();
                // else get_template_part( 'includes/navigation', 'entry' );
            else:
                get_template_part( 'includes/no-results', 'entry' );
            endif; ?>
            </div>
            <div style="padding: 30px;float: right;">
            <?php if(function_exists('ajax_paging_more_post')) ajax_paging_more_post('More News +'); ?>
            </div>
        </div> <!-- #main-area -->

        <?php get_sidebar(); ?>
    </div> <!-- #content-area -->


<?php get_footer(); ?>

We want the Updates page meganrapinoe.com.php53-9.dfw1-1.websitetestlink.com/updates/ same as home page without the slider and the three boxes.. So, I removed all the code related to the slider and box and make a new templates for update page. But please see this is something strange. Please tell me how to fix that.

Thanks
Sayeed

2
Contributors
1
Reply
19
Views
3 Years
Discussion Span
Last Post by EvolutionFallen
0

Check the WordPress Codex and look into creating a custom WP Loop using query_posts(). Your page is the Updates page, so when you do if(have_posts()) it will check what the content is for that page (i.e., what's in the textarea for that page in the WP backend). You need a custom loop since you want to pull in specific blog posts, rather than Page content.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.