• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Running Multiple Loops

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Running Multiple Loops

This topic is: not resolved

Tagged: Custom Post Type, custom taxonomy, multiple loops, secondary

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 4 months ago by Sridhar Katakam.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • December 12, 2013 at 5:38 pm #78671
    thoughtwell
    Member

    I cannot get my second loop to run on my single page template for my custom post type of video.

    I'm trying to show the video up top, followed by the description. I achieved this using the_content()

    What I want to do is hook into the genesis_after_loop and insert an output of 6 videos from the same category from that taxonomy.

    This is what I have:

    <?php
    /**
     * The custom Videos post type single post template
     */
    
    /** Force full width content layout */
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
    
    /** Remove the post info function */
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    
    /** Add 'Case Study:'' text to Title: Thanks Adamcap.com: http://adamcap.com/code/filter-genesis-h1-post-titles-to-add-for-styling/ */
    add_filter( 'genesis_post_title_output', 'vid_post_title_output', 15 );
     
    function vid_post_title_output( $title ) {
     
    	if ( is_singular() )
    		$title = sprintf( '<h1 class="entry-title"><span class="case-study">Case Study:</span> %s</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
     
    	return $title;
     
    }
    
    //* Remove the post content */
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    
    //* Add Post Content back in the way we want it done */
    
    function smt_video_staging() {
    
    	echo '<div class="video-feed">';
    		the_content();
    	echo '</div>';
    }
    
    add_action( 'genesis_entry_content', 'smt_video_staging' );
    
    /** Remove the post meta function */
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    
    /** Remove the author box on single posts */
    remove_action( 'genesis_after_entry', 'genesis_do_author_box_single' );
    
    /** Remove the comments template */
    remove_action( 'genesis_after_entry', 'genesis_get_comments_template' );
    
    /** Add Video Feed Output below single post */
    
    function smt_video_feed_op() {
    
    	wp_reset_query();
    
    	$otherVids = new WP_Query();
    	$otherVids -> query('posts_per_page=6&cat=136');
    	while ($otherVids->have_posts()) : $otherVids->the_post();
    		if ( has_post_thumbnail() ){
    			echo '<div class="videos-featured-image">';
    			echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
    			echo get_the_post_thumbnail($thumbnail->ID, 'videos' );
    			echo '</a>';
    			echo '</div>';
    	endwhile;
    
    	wp_reset_query();
    }
    
    add_action( 'genesis_after_loop' , 'smt_video_feed_op');
    
    genesis();

    I'm no PHP programmer by a longshot, but I'm trying to learn and this is the best I've managed to come up w/ after extensive reading about loops, queries, etc. If I can even get this to 'crudely' output a feed, I can pretty much take it from there, but my page is not showing up w/ the above code. I have a reason to believe it's something to do with the if statement in my smt_video_feed_op() function (since that is what broke my page). Can ANYONE w/ some php gusto chime in to maybe point me in the right direction?

    December 14, 2013 at 12:51 am #78997
    Sridhar Katakam
    Participant

    can be easily done using Views plugin. Not sure if you are fine with using a plugin for doing this though.


    Genesis Tutorials | Follow me on Twitter

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble