This topic is: not resolved
- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
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.
Community Forums › Forums › General Genesis Framework Discussions › Adding in php output on single.php
Tagged: single.php
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();
?>
Does anyone have any tips?
© 2023 WPEngine, Inc.