Forum Replies Created
-
AuthorPosts
-
kjviettiMember
Thanks for your help Chris and for pointing me in the right direction (inserting the hero/top stuff before the content of the page). Your solution will definitely work.
This website only has four pages that I need to do this on, for my own challenge I'm wondering if there's a way to dynamically pull in the text that I have to left of the image on each page in without defining it in the hook. Similar to what I'm doing for the page title and featured image in my code below:
add_action( 'genesis_before_content', 'single_post_featured_image', 1 ); function single_post_featured_image() { if ( (! is_singular( 'page' ) || !has_post_thumbnail()) || wp_is_mobile() ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'hero-image' ) ) ); echo '<div class="hero-wrap"><div class="hero-header">'; genesis_do_post_title(); echo '</div>'; echo '<div class="hero-image">'; printf ( $img ); echo '</div></div>'; remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
Again, certainly not something that's necessary in this case. But my thought is that in the future if I have clients updating sites like this it would be nice to just have them add a class to the text they want to show up to the left of the image and assign it a class that runs before the page content. I'm pretty certain this isn't possible, but thought that greater minds might have an idea 🙂
kjviettiMemberHey Chris,
Thanks for the reply. I tried that before and just tried it again (to make sure I didn't miss anything). This gets the sidebar to display to the right, but I want it to display to the right and underneath the image of the man with balloons in his pocket.
I thought that I could do this by adding an additional class to the text on the page underneath the image (.inpage), float it left and reduce the width but sidebar still stays below everything.
Hopefully you understand what I'm getting at and have some other ideas!
-kyle
-
AuthorPosts