Community Forums › Forums › Archived Forums › Design Tips and Tricks › Full width welcome widget for elelven40
- This topic has 6 replies, 2 voices, and was last updated 10 years, 7 months ago by Brad Dalton.
-
AuthorPosts
-
September 6, 2013 at 4:50 pm #61152afinevoMember
Hello everyone, here is my dilemma. I am using the eleven40 theme (non pro) that currently uses the SEO page title widget to run a banner ad. What I want to do is use that widget on the home page only and any other page I choose for a text tag line for seo purposes. My thinking is that I can use a plugin to determine which additional pages I want to use it on. I then want to duplicate that style of widget (welcome text widget?) to run directly below the title page widget (or in place of it if it is not showing) in order to run a banner ad or input more text if needed. The styling of the widget would be the same. Again, I would use a plugin to determine what pages and posts that widget would appear on.
There is a post from earlier this year that has a link to create such a widget that includes the CSS for the same borders as the page title widget. - http://www.briangardner.com/welcome-text-widget/. I thought it was just what I needed but it returns a 404 and says to go to Studio Press for the code snippet. Unfortunately it is not there. I did find an article by Brian Gardner in search that shows how to add a welcome text widget to eleven40 - http://www.briangardner.com/home-widget-area-eleven40/, but the widget is not full width and is placed in the wrong area. It actually sits atop the content of the page or post next to the sidebar. Plus it's for the homepage only.
Can someone help me out with this or point me in the right direction for this article or code snippet? I didn't think it would be this tough to get it done but I've been working on this for a while now.
Thanks,
Shea
http://allgaragefloors.comSeptember 6, 2013 at 11:35 pm #61191Brad DaltonParticipantSimply change the hook position to one which extends the container full width.
Example:
From this:
genesis_before_loop
To this:
genesis_before_content_sidebar_wrap
You can then add a conditional tag below the function:
Example:
https://gist.github.com/braddalton/6473041
September 9, 2013 at 12:48 pm #61557afinevoMemberThanks Brad! The hook position change is exactly what was needed. I wasn't able to implement the conditional tag however. Every time I tried it would reject it with a white screen.
What I decided I would like to do instead though is make this widget available for all pages and posts as well, just like the page title widget. How would I go about doing that? I assume I could work on the conditional tags later if I wish to regulate where I don't want the widget to show.
September 9, 2013 at 5:14 pm #61598afinevoMemberOK, I seemed to have figured out how to accomplish what I wanted to do. I moved this:
/** Add the home featured section */
add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_home_featured' );
function eleven40_home_featured() {/** Do nothing on page 2 or greater */
if ( get_query_var( 'paged' ) >= 2 )
return;genesis_widget_area( 'home-featured', array(
'before' => '<div class="home-featured widget-area">',
) );}
from the home.php to the function.php. It now shows on all pages like the page title widget. It's working but I still wonder if it was the correct thing to do?
Thanks
September 10, 2013 at 9:58 am #61685Brad DaltonParticipantSeptember 10, 2013 at 10:56 am #61699afinevoMemberThanks for your help Brad. I just wasn't sure if it was correct or not.
September 10, 2013 at 11:51 am #61717Brad DaltonParticipantThe code in the home.php only works on the home page.
Any code in a template on works on that template whereas you can hook in content from your functions file using conditional tags for any page on your site.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.