Пример #1
0
    $counter = 0;
    while (have_posts()) {
        // Increase loop counter
        $counter++;
        the_post();
        /* Include the Post-Format-specific template for the content.
         * If you want to overload this in a child theme then include a file
         * called loop-___.php (where ___ is the Post Format name) and that will be used instead.
         */
        get_template_part('loop', get_post_format());
    }
    // endwhile have_posts()
    ?>
	    		
	    		</div><!-- .row --><?php 
    wpsight_pagination();
} else {
    get_template_part('loop', 'no');
}
// endif have_posts()
?>
	    
	    </div><!-- #content -->
	    
	    <?php 
get_sidebar();
?>
	
	</div><!-- #main-middle -->
	
	<?php 
Пример #2
0
        $counter = 0;
        while ($blog_query->have_posts()) {
            // Increase loop counter
            $counter++;
            $blog_query->the_post();
            /* Include the Post-Format-specific template for the content.
             * If you want to overload this in a child theme then include a file
             * called content-___.php (where ___ is the Post Format name) and that will be used instead.
             */
            get_template_part('loop', get_post_format());
        }
        // endwhile have_posts()
        ?>
	    				
	    				</div><!-- .row --><?php 
        wpsight_pagination($blog_query->max_num_pages);
    } else {
        get_template_part('loop', 'no');
    }
    // endif have_posts()
} else {
    the_content();
}
// endif ! post_password_required()
?>
	    
	    </div><!-- #content -->
	    
	    <?php 
get_sidebar();
?>
Пример #3
0
/**  
 *	Function to build properties list
 *	@param array $query: data return from WP_Query function
 *	@param string $width: width class of each prorperty in list
 *	@param string $clear: clear float class - 'clear' or ''
 *	@param int $length: number of words displayed in property's excerp
 *	
 */
function build_property_list($query, $blockTitle = '', $order = true, $compare = true, $filter = false, $width = 'span3', $clear = '', $length = 25)
{
    if ($query->have_posts()) {
        $id = 'home-bottom';
        ?>
		<div id="properties-row">
		<?php 
        if ($blockTitle != '') {
            // If has title
            ?>
		<div class="title title-widget clearfix">
			<h2><?php 
            echo $blockTitle;
            ?>
</h2>
			<?php 
            if ($compare) {
                ?>
				<div class="title-actions title-actions-compare">
					<button id="fe-favorites-compare" class="btn btn-mini"><i class="icon-th"></i> <?php 
                _e('Compare', 'wpsight');
                ?>
</button>
				</div>
			<?php 
            }
            ?>
			<?php 
            if ($order) {
                ?>
				<?php 
                buildOrderOptions();
                ?>
			<?php 
            }
            ?>
		</div>
		<?php 
        }
        // End if block title
        if ($filter) {
            $filterOptions = custom_subpages_filter_form_details();
            echo buildFilterForm($filterOptions);
        }
        ?>
		
		<div class="widget widget-latest row">
		<?php 
        while ($query->have_posts()) {
            // Set up post data
            $query->the_post();
            ?>
			
			<div <?php 
            post_class($width . $clear . ' clearfix');
            ?>
>
			
				<div class="widget-inner">
				
					<?php 
            // Action hook before post title (widget)
            do_action('wpsight_widget_listing_title_before', $width, $id);
            ?>
					
					<h3 class="post-title">
						<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title_attribute();
            ?>
" rel="bookmark">
							<?php 
            // Action hook post title inside
            do_action('wpsight_widget_listing_title_inside');
            the_title();
            ?>
						</a>
					</h3>
						
					<?php 
            // Action hook after post title (widget)
            do_action('wpsight_widget_listing_title_after', $width, $id);
            // Action hook before post content (widget)
            do_action('wpsight_widget_listing_content_before', $width, $id);
            ?>
						
					<div class="post-teaser">
						<?php 
            wpsight_the_excerpt(get_the_ID(), false, $length);
            ?>
					</div>
					
					<?php 
            if ($compare) {
                $attr = array();
                echo build_compare_table($attr);
            }
            // Action hook after post content (widget)
            do_action('wpsight_widget_listing_content_after', $width, $id);
            ?>
					
				</div><!-- .widget-inner -->
							
			</div><!-- .post.<?php 
            the_ID();
            ?>
 --><?php 
            // Increase loop counter
            $counter++;
        }
        // endwhile have_posts()
        ?>
		</div> <!-- End properties list -->
		<?php 
        if ($order) {
            wpsight_pagination($favorites_query->max_num_pages);
        }
        ?>
		</div> <!-- End container -->
	<?php 
    } else {
        if ($blockTitle != '') {
            // If has title
            ?>
		<div class="title title-widget clearfix">
			<h2><?php 
            echo $blockTitle;
            ?>
</h2>
		</div>
		<div class="property-list-empty"> <?php 
            echo __('No property found.', 'wpsight');
            ?>
</div>
		<?php 
        }
        // End if block title
    }
    wp_reset_query();
}
Пример #4
0
	    			
	    			    <?php 
    // Create loop counter
    $counter = 0;
    while ($favorites_query->have_posts()) {
        // Increase loop counter
        $counter++;
        $favorites_query->the_post();
        // Include listing loop template
        get_template_part('loop', 'listing');
    }
    // endwhile have_posts()
    ?>
	    			
	    			</div><!-- .row --><?php 
    wpsight_pagination($favorites_query->max_num_pages);
    // Action hook to add content after favorites content
    do_action('wpsight_listing_favorites_after', $_COOKIE[WPSIGHT_COOKIE_FAVORITES]);
} else {
    ?>
	    		
	    			<div class="post no-posts">
	    	
                        <div class="alert">
                        	<?php 
    echo apply_filters('wpsight_no_favorites_text', __('<strong>Sorry!</strong> You have no favorites at the moment.', 'wpsight'));
    ?>
                        </div>
                    
                    </div><!-- .post --><?php 
}
Пример #5
0
function wpsight_do_start_screen()
{
    // Activate welcome screen
    $welcome = apply_filters('wpsight_welcome_screen', true);
    if ($welcome == true) {
        ?>
	
		<div id="content" class="span12">
		
			<div id="welcome" class="post">
			
				<h1><?php 
        _e('Thank You!', 'wpsight');
        ?>
</h1>
			
				<p><?php 
        printf(__('Thank you very much for using the <strong>%1$s</strong> theme.', 'wpsight'), WPSIGHT_NAME);
        ?>
</p>
				
				<div class="row">
				
					<div class="span6">
				
						<h2 class="well" style="padding:5px 15px"><?php 
        _e('What Next?', 'wpsight');
        ?>
</h2>	    					
						<ul>	   					    
	   					    <li><?php 
        _e('Add some content', 'wpsight');
        ?>
 &rarr; <?php 
        printf(__('Create a new %1$s, %2$s or %3$s', 'wpsight'), '<a href="' . admin_url() . 'post-new.php">' . __('post', 'wpsight') . '</a>', '<a href="' . admin_url() . 'post-new.php?post_type=page">' . __('page', 'wpsight') . '</a>', '<a href="' . admin_url() . 'post-new.php?post_type=' . wpsight_listing_post_type() . '">' . __('listing', 'wpsight') . '</a>');
        ?>
</li>	    				    
	   					    <li><?php 
        _e('Make your settings in the theme options', 'wpsight');
        ?>
 &rarr; <a href="<?php 
        echo admin_url();
        ?>
admin.php?page=<?php 
        echo WPSIGHT_DOMAIN;
        ?>
"><?php 
        _e('Theme options', 'wpsight');
        ?>
</a></li>	   					    
	   					    <li><?php 
        _e('Drag widgets to the home page widget area', 'wpsight');
        ?>
 &rarr; <a href="<?php 
        echo admin_url();
        ?>
widgets.php"><?php 
        _e('Edit widgets', 'wpsight');
        ?>
</a></li>	   					    
	   					    <li><?php 
        _e('Add items to the main menu', 'wpsight');
        ?>
 &rarr; <a href="<?php 
        echo admin_url();
        ?>
nav-menus.php"><?php 
        _e('Create a custom menu', 'wpsight');
        ?>
</a></li>	   					
	   					</ul>	   					
	   				</div>
	   				
	   				<div class="span6">	   				
	   					<h2 class="well" style="padding:5px 15px"><?php 
        _e('Example Content?', 'wpsight');
        ?>
</h2>	    		
						<p><?php 
        _e('To get started with the theme you may also want to upload some dummy content (also see <a href="http://codex.wordpress.org/Importing_Content#WordPress" target="_blank">codex</a> about importing content)', 'wpsight');
        ?>
</p>						
						<p><a href="http://wpcasa.com/download/<?php 
        echo apply_filters('wpsight_example_xml_name', WPSIGHT_DOMAIN);
        ?>
.xml" class="btn btn-success btn-mini"><?php 
        _e('Download XML', 'wpsight');
        ?>
</a></p>	   				
	   				</div>
	   			
	   			</div><!-- .row -->
	   			
	   			<h2><?php 
        _e('Need Help?', 'wpsight');
        ?>
</h2>	   			
	   			<p><?php 
        _e('If you need any help, please head over to the <a href="http://wpcasa.com/support/" target="_blank">support center</a>.', 'wpsight');
        ?>
</p>
			
			</div><!-- #welcome -->
		
		</div><!-- #content --><?php 
    } else {
        // When welcome is false show latest posts
        // Set args for home custom query
        $home_query_args = array('posts_per_page' => get_option('posts_per_page'), 'paged' => get_query_var('paged'));
        $home_query_args = apply_filters('wpsight_home_query_args', $home_query_args);
        $home_query = new WP_Query($home_query_args);
        if ($home_query->have_posts()) {
            // Set class of #content div on home depending on active sidebars
            $content_class = is_home() && (is_active_sidebar('sidebar') || is_active_sidebar('sidebar-archive')) ? wpsight_get_span('big') : wpsight_get_span('full');
            ?>
	    	    
	    	<div id="content" class="<?php 
            echo $content_class;
            ?>
">
									
		    	<div class="row">
		    	
		    		<?php 
            // Create loop counter
            global $counter;
            $counter = 0;
            while ($home_query->have_posts()) {
                // Increase loop counter
                $counter++;
                $home_query->the_post();
                /* Include the Post-Format-specific template for the content.
                 * If you want to overload this in a child theme then include a file
                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                 */
                get_template_part('loop', get_post_format());
            }
            // endwhile have_posts()
            ?>
		    	
		    	</div><!-- .row --><?php 
            wpsight_pagination($home_query->max_num_pages);
            ?>
		    
		    </div><!-- #content --><?php 
            get_sidebar();
        } else {
            get_template_part('loop', 'no');
        }
        // endif have_posts()
    }
    // endif $welcome
}
Пример #6
0
	    			
	    			    <?php 
        // Create loop counter
        $counter = 0;
        while ($listing_query->have_posts()) {
            // Increase loop counter
            $counter++;
            $listing_query->the_post();
            // Include listing loop template
            get_template_part('loop', 'listing');
        }
        // endwhile have_posts()
        ?>
	    			
	    			</div><!-- .row --><?php 
        wpsight_pagination($listing_query->max_num_pages);
    } else {
        get_template_part('loop', 'no');
    }
    // endif have_posts()
} else {
    the_content();
}
// endif ! post_password_required()
?>
	    
	    </div><!-- #content -->
	    
	    <?php 
get_sidebar('listing');
?>