• 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

Best Place To Customize Loops, Widgets, Functions

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 › General Discussion › Best Place To Customize Loops, Widgets, Functions

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 6 years, 11 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 1, 2016 at 1:19 pm #184772
    muzicman82
    Member

    Hi all,

    I'm using the Lifestyle Theme, but I'm not sure my questions are specific to that. I need to customize the output of some of the Genesis/Lifestyle loops or widgets. What is the best approach to this so I am not modifying Genesis directly?

    I imagine there are code chunks I can copy out of original Genesis files and put in the Lifestyle Child Theme and modify there.

    One main one is the Featured Posts Widget. On this widget, I want to override where the link takes you. So, on the homepage, I have it setup as a post with content, but when it is clicked on, I want it to take you somewhere else, not to this post. One way I thought to specify where it takes you is to add a Custom Field to the post, where the value is the post ID of where the link should go, but I need to modify the Widget output to include this. I also want the Title for the "show title" option on the bottom left/right to be centered for the Featured Category part.

    Thanks.

    May 1, 2016 at 7:56 pm #184777
    Brad Dalton
    Participant

    I imagine there are code chunks I can copy out of original Genesis files and put in the Lifestyle Child Theme and modify there.

    Genesis includes the genesis_custom_loop function you can use to create a custom loop however this does not apply to the featured posts widget which uses its own WP_Query.

    function genesis_custom_loop( $args = array() ) {
    
    	global $wp_query, $more;
    
    	$defaults = array(); //* For forward compatibility
    	$args     = apply_filters( 'genesis_custom_loop_args', wp_parse_args( $args, $defaults ), $args, $defaults );
    
    	$wp_query = new WP_Query( $args );
    
    	//* Only set $more to 0 if we're on an archive
    	$more = is_singular() ? $more : 0;
    
    	genesis_standard_loop();
    
    	//* Restore original query
    	wp_reset_query();
    
    }
    

    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ 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

© 2023 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