Community Forums › Forums › Archived Forums › General Discussion › Relocation of Entry Title and Text Widget to Outside Content Sidebar Wrap
Tagged: content sidebar wrap, entry-title, parallax-pro
- This topic has 8 replies, 2 voices, and was last updated 9 years, 1 month ago by
susanta.
-
AuthorPosts
-
February 8, 2016 at 12:34 pm #178588
susanta
ParticipantI'm trying to hook a text widget within the entry title that is located at genesis_before_content_sidebar_wrap.
Although I'm able to relocate the text widget to the same location as the entry title, it doesn't stay under the relocated entry title within the same div.
I've had a look at the hook reference on this site as well as the visual hook guide. However, I haven't been able to figure it out quite well as yet.
Would appreciate your help!
Cheers,
http://theseomonthly.com/seo-audit/February 8, 2016 at 7:48 pm #178616Christoph
MemberHi,
I don't quite understand your issue.
http://screencast.com/t/ySNNHBf3cR5You have everything located where you want it and entry-title and the widget-area are inside the same div, .site-inner...
Can you explain what exactly you expect to happen/show?
February 8, 2016 at 10:53 pm #178623susanta
ParticipantHello Christoph,
Thanks a lot for reaching out to me! Appreciate it very much!
I'm sorry this caused confusion - let me explain what I want to achieve to help you better understand the issue I'm facing.
I would like to keep the intro title and text widget within the same div so they appear this way: http://www.awesomescreenshot.com/image/978377/1628427e75252b310f014db494d8f1bc
(This could be achieved through making the following CSS tweak)
header.entry-header {
background: #aaa;
}However, I also wanted to relocate both of them to outside the content wrap in order to help them appear screen-wide.
To achieve that, I made the following changes to functions.php file:
//* Reposition the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_post_title', 2 );//* Register Sidebar to add a conditional widget
genesis_register_sidebar( array(
'id' => 'cta-2',
'name' => __( 'Audit Intro Text', 'mp' ),
'description' => __( 'This is the call to action section.', 'mp' ),
) );add_action( 'genesis_before_content_sidebar_wrap', 'audit_intro_text' );
function audit_intro_text() {
// If it's the SEO Audit page, display CTA #2
if ( is_page( 'seo-audit' ) ) {
genesis_widget_area( 'cta-2', array(
'before' => '<div id="cta"><div class="wrap">',
'after' => '</div></div>',
) );}
}After making the changes, I can see this now: http://www.awesomescreenshot.com/image/978452/bad4a11123d50ea57ffc0c6179bb302c
Therefore, the the text widget is not appearing within the entry-title div outside the wrap. Hence, the issue.
Please, let me if I was able to explain the issues clearly.
Thanks a ton for your time and help again!
February 9, 2016 at 12:10 am #178630Christoph
MemberThank you, now I understand.
You don't really need a div. You simply want a container that includes both elements.
Why not relocate the entry_header_markup, too?remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); add_action( 'genesis_before_content_sidebar_wrap', 'genesis_entry_header_markup_open', 5 ); add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_post_title' );
And change
'after' => '</div></div>',
to
'after' => '</div></div></header>',
And add a background to entry-header.
http://screencast.com/t/t8gJCg3EoL6
http://screencast.com/t/yRZ4zr8fYYvW
February 9, 2016 at 3:06 am #178636susanta
ParticipantThanks a lot for the quick help! It indeed helped me achieve the desired result!
However, this seems to be interfering with the blog home and blog category sections in way that is unwarranted. (http://theseomonthly.com/news/)
For example, it disregard the excerpts and shows the entire posts. Additionally, it hides/removes the post titles in all posts from the second post onward.
Is there way to stop this from happening?
February 9, 2016 at 4:12 am #178637susanta
ParticipantMoreover, the entry-title is also appearing on the home page (http://www.awesomescreenshot.com/image/979201/b51c91deffd97aa4d8b00890275be92e)
This is an aberration as I'm using Parallax Pro theme which has a widgetized front page.February 9, 2016 at 5:13 am #178638susanta
ParticipantAlright, I figured out the full post display thing - it's because of the settings, but the hidden post titles from the second post onward issue could be caused by the code snippets. Just wanted to share this with you for clarity.
PS: Currently, I have removed the code so you can't possibly see the issues I have discussed above. If you want me to replicate the issues, I can put the code back.
February 9, 2016 at 10:11 am #178657Christoph
MemberYou can wrap the code to move the entry_title_wrap in a conditional to only target that page or create a page template that includes the relocation and the displaying the widget area (without the conditional)
February 9, 2016 at 10:59 am #178664susanta
ParticipantI see! Thanks a lot for your time and help! I truly appreciate it!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.