• Please help!

    Where is the loop here?

    <?php get_header(); ?>
    
                            <hgroup class="page-head">
                            		<?php
                                    	$page_title = get_post_meta($post->ID,'page_title',true);
    									if(empty($page_title))
    									{
    										$page_title = get_the_title();
    									}
    									$page_sub_title = get_post_meta($post->ID,'page_sub_title',true);
    								?>
                                    <h2><?php echo $page_title; ?></h2>
                                    <h5><?php echo $page_sub_title; ?></h5>
                            </hgroup>
    
                            <div id="container" class="clearfix">
    
                                    <div id="content">
    					<h1 class="post_title"><?php echo get_the_title(); ?></h1>
                                    		<?php
    										if ( have_posts() ) :
    										while ( have_posts() ) :
    										the_post();
    
    										?>
    										<article id="post-<?php the_ID(); ?>" <?php post_class("clearfix"); ?>>
    <?php
    if(is_page(284)){
    $args = array(
        'post_type'      => 'page',
        'posts_per_page' => -1,
        'post_parent'    => $post->ID,
    	'post_status' => 'publish',
        'order'          => 'DESC',
        'orderby'        => 'date'
     );
    
    $parent = new WP_Query( $args );
    
    if ( $parent->have_posts() ) : ?>
    <ul>
        <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
    <?php
    $page_title = get_post_meta($post->ID,'page_title',true);
    if(empty($page_title)) {
    	$page_title = get_the_title();
    }
    $page_sub_title = get_post_meta($post->ID,'page_sub_title',true);
    ?>
    <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> - <?php echo $page_sub_title; ?></li>
        <?php endwhile; ?>
    </ul>
    <?php endif; wp_reset_query();
    }
    ?>
    
    											<header>
    
    												<?php
    												if ( has_post_thumbnail() )
    												{
    														?>
    														<div class="post-thumb">
    																<?php
    																$image_id = get_post_thumbnail_id();
    																$featured_image = wp_get_attachment_image_src( $image_id,'std-service-thumbnail' );
    
    																$theme_use_lightbox = get_option('theme_use_lightbox');
    																if($theme_use_lightbox == 'true')
    																{
    																	$full_image_url = wp_get_attachment_url($image_id);
    																	echo '<a href="'.$full_image_url.'" title="'.get_the_title().'" class="pretty-photo">';
    																	echo '<img src="'.$featured_image[0].'" alt="'.get_the_title().'">';
    																	echo '</a>';
    																}
    																else
    																{
    																	echo '<a href="'.get_permalink().'" title="'.get_the_title().'" >';
    																	echo '<img src="'.$featured_image[0].'" alt="'.get_the_title().'">';
    																	echo '</a>';
    																}
                                                                    ?>
                                                            </div>
                                                   			<?php
    												}
    												?>
    											</header>			
    
                                                <?php the_content(); ?>                                            																					                                            
    
    										</article>
    
                                            <?php wp_link_pages(array('before' => '<div class="pages-nav"><strong>'.__('Pages', 'framework').'</strong> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>	
    
                                        	<?php
    										endwhile;
    											comments_template();
    										endif;
    										?>
    
                                    </div>
    
                                    <?php get_sidebar('page'); ?>                                
    
                                    <?php get_template_part('sections/twitter'); ?>
    
                            </div><!-- end of container -->
    
    <?php get_footer(); ?>

    I need to replace the loop in theme page.php to configure woocomerce. I am using HEALTHPRESS. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • @infoserv2011
    In this code wp_reset_query() above all code is loop.
    But whats need in this please explain more.

    Thread Starter infoserv2011

    (@infoserv2011)

    thansks Ravipatel. I need to do this steps for woocomerce integration

    Duplicate page.php

    Duplicate your theme’s page.php file, and name it woocommerce.php. This file should be found like this: wp-content/themes/YOURTHEME/woocommerce.php.

    Edit your page (woocommerce.php)

    Open up your newly created woocommerce.php in a text editor, or the editor of your choice.

    Replace the loop

    Next you need to find the loop (see The_Loop). The loop usually starts with a:

    <?php if ( have_posts() ) :
    and usually ends with:

    <?php endif; ?>
    This varies between themes. Once you have found it, delete it. In its place, put:

    <?php woocommerce_content(); ?>

    https://docs.woothemes.com/document/third-party-custom-theme-compatibility/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Healthpress page php loop’ is closed to new replies.