• 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

Adding in php output on single.php

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 › General Genesis Framework Discussions › Adding in php output on single.php

This topic is: not resolved

Tagged: single.php

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 13, 2022 at 3:26 pm #504832
    mickonblogging
    Participant

    Hi Studiopress community!

    I'm trying to customize my single.php to get a header before the main content and sidebar that is full-width and contains the Featured image, H1, and some other post data. Here is the template that I'm trying to achieve: https://ahrefs.com/blog/orchard-seo-strategy/

    So far, I've learned about Genesis hooks and learned how I can take the title out of my post and display it in the section before the content and sidebar.

    My only problem is that I can't seem to figure out how to put this data inside a <div> so that I can adjust the styling to make it look a little more like the example that I showed.

    Can anyone help me understand how I can add <div>'s or other options so that I can adjust the styling?

    Here is the php I'm currently using on single.php:

    <?php
    add_action( 'genesis_before_content_sidebar_wrap', 'single_post_featured_image', 5 );

    function single_post_featured_image() {

    if ( ! is_singular( 'post' ) )
    return;

    $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
    printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img );

    }

    add_action ('genesis_before_content_sidebar_wrap', 'genesis_do_post_title', 10 );
    add_action ('genesis_before_content_sidebar_wrap', 'genesis_post_info', 12 );

    remove_action ('genesis_entry_header', 'genesis_do_post_title', 10 );
    remove_action ('genesis_entry_header', 'genesis_post_info', 12 );

    genesis();
    ?>

    March 21, 2022 at 3:35 pm #504866
    mickonblogging
    Participant

    Does anyone have any tips?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

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