• 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

How do I use a Genesis Theme in my custom code

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 › How do I use a Genesis Theme in my custom code

This topic is: not resolved

Tagged: genesis sample, posts, profile page, rendering, template, user post, user posts

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 2 months ago by Victor Font.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 7, 2017 at 6:49 pm #198977
    patrickr
    Member

    Hi there!

    I'm new to the Genesis Framework and WordPress. I'm trying to understand how to use my Genesis Sample's post template in my custom code.

    For example, I'm creating a profile page where logged in users can see all of their blog posts, plus access some profile settings. Getting the user's posts is pretty straightforward:

    
    $user_id = get_current_user_id();
    $args = array('author' => $user_id);
    $posts = get_posts( $args );
    

    Now that I have an array of posts contained within $posts, I need to loop through and render them. This is the part I'm unsure of; what does that loop look like so that the posts on the profile page render the same way the posts on the homepage of the Genesis Sample theme render?

    A code snippet would be really helpful, but also pointing me in the right direction, in terms of documentation or digging through the theme's source code, so that I can teach myself, would be appreciated. Thanks so much!

    Cheers

    http://local
    January 8, 2017 at 6:56 am #199006
    Victor Font
    Moderator

    The Genesis Sample theme doesn't have a custom post_template. It uses the post template from the framework. You should never modify any framework file. You will eventually break your site and lose your work.

    If you want a custom loop, you don't even need a custom post template. All you have to do is create your loop in functions.php, remove the standard loop action and hook your new function into the loop. This is one way to do it: http://www.genesissnippets.com/2012/09/15/genesis-custom-loop/.

    If you Google Genesis Custom Loop, you find there are many ways to do what you want.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    January 8, 2017 at 7:35 pm #199038
    patrickr
    Member

    Thanks for the reply, Victor. I took a look at the link, and I understand I need to create a custom loop, but what I don't understand is what that loop should look like to get the same design as the blog posts on the homepage. The workflow is something like:

    Get logged in user's posts -> Pass the posts to the custom loop

    I have the logged in user's posts. How do I pass them to the loop in the form of a variable and what does that loop look like?

    The latter is probably as straightforward as finding the loop that renders the posts on the homepage, and copy/pasting it into the functions.php file, with a tweak for it to accept the variable containing the posts.

    Cheers

    January 9, 2017 at 3:02 pm #199080
    Victor Font
    Moderator

    All the Genesis loops can be found in the lib/structure/loops.php file.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 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