Community Forums › Forums › Archived Forums › Design Tips and Tricks › Metro theme: adding "Welcome Text" widget per B Gardner's code – help?
- This topic has 28 replies, 4 voices, and was last updated 11 years, 7 months ago by Jen Baumann.
-
AuthorPosts
-
May 4, 2013 at 11:16 am #39277kay9Participant
Hi, I'm trying to follow B Gardner's tutorial here as to how to add a "Welcome Text" widget to a Genesis child theme (Metro, in this case).
The code is easy enough, cut and pasted in as he said to do in the tutorial.
BUT ... the text of the welcome area widget is NOT responding to the CSS I have -- it is defaulting to the "default" text (in both style AND in size). I want it to be in a larger size and font (Oswald, perhaps; which is the font for the theme's headlines, yes?).
Can someone tell me why the CSS isn't working? I have looked at it with Firebug and still can't figure out what change to the CSS I need to make to change the font for that widget area AND the size of the font for that widget area. Perhaps the tutorial will not work for the Metro theme?
Thanks in advance for clues!
The site is here. You can see the default font and font-size in the "welcome" widget area at the top of the front page.
May 5, 2013 at 3:07 am #39331Brad DaltonParticipantTry this:
.welcome-text p { font-size: 24px; font-family: Georgia; line-height: 1.0; margin: 0; }
What happens if you change this part of the code and add a font-family?
font-size: inherit; font-family: Georgia;
May 5, 2013 at 3:18 am #39336kay9ParticipantThanks for the reply! Hmm, NOTHING happened. I just tried every combo I could think of!
There must be something else going on here, and it's too far above my pay grade to understand. 🙁
May 5, 2013 at 8:13 am #39353Brad DaltonParticipantSometimes the changes can take time to show up especially if you have server side caching.
May 5, 2013 at 9:36 am #39371kay9ParticipantHm, no, nothing like that, I don't think. I may try posting this on the thread at Brian's website where he originally posted this tutorial, and see if he responds. Thank you though, for trying to help me! I do appreciate it very much. 🙂
May 5, 2013 at 10:03 am #39377AnitaCKeymasterBrian included this CSS on that post. Did you add it to your style sheet? Maybe you overlooked this part, but it works just fine for me.
/* Welcome Text ------------------------------------------------------------ */ .welcome-text { border-bottom: double #ddd; border-top: double #ddd; font-family: 'Lora', serif; font-size: 30px; line-height: 1.0; overflow: hidden; padding: 25px 0; text-align: center; } .welcome-text p { font-size: inherit; line-height: 1.0; margin: 0; }
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:05 am #39378kay9ParticipantNope, as I said above, I cut and pasted all, following his tutorial.
May 5, 2013 at 10:09 am #39379AnitaCKeymasterJust looked at your code -
You are missing the closing */ on the end here -
/* Welcome Text
------------------------------------------------------------ */
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:11 am #39380kay9ParticipantOhh no, I have his code commented out just below my version of it! Above 🙂
Just removed his version so it doesn't confuse. Anything else going on that explains why it isn't working?
Thank you for trying! 🙂
May 5, 2013 at 10:21 am #39382AnitaCKeymasterI think you have another conflict going on there. I am using this as a Demo site here and it's working fine. I even tried to add my code to your site via Firebug and it's not working. I would check your code in the function.php file character by character.
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:22 am #39383AnitaCKeymasterAre you using any other plugins... maybe the Featured Widget Amplified?
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:26 am #39384kay9ParticipantI am using plugins, yep, but not that one. I'll try checking the function.php code but I'm not much of a php person. Gah!
May 5, 2013 at 10:29 am #39386kay9ParticipantThis is at the end of my functions.php file:
`/** Add the welcome text section */
add_action( 'genesis_before_content_sidebar_wrap', 'custom_welcome_text' );
function custom_welcome_text() {
genesis_widget_area( 'welcome-text', array(
'before' => '',
) );
}`May 5, 2013 at 10:36 am #39387Brad DaltonParticipantThe code is wrong. It should be:
/** Add the welcome text section */ add_action( 'genesis_before_content_sidebar_wrap', 'custom_welcome_text' ); function custom_welcome_text() { genesis_widget_area( 'welcome-text', array( 'before' => '<div class="welcome-text widget-area">', ) ); }
And make sure you also have the PHP to register the widget.
/** Register widget areas */ genesis_register_sidebar( array( 'id' => 'welcome-text', 'name' => __( 'Welcome Text', 'genesis' ), 'description' => __( 'This is the welcome text widget.', 'themename' ), ) );
Source http://www.briangardner.com/welcome-text-widget/
May 5, 2013 at 10:38 am #39388AnitaCKeymasterI think the code they provided is right. They didn't use the PHP code like you did.
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:39 am #39389AnitaCKeymasterI see the widget there, it's just not formatting correctly. Send me an email on my website and I will try to help you offline.
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:39 am #39390kay9ParticipantWow I'm really confused now. I just cut and pasted and saved the code from braddalton and it's still not working. 🙁
This is what's in there now:
`/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'welcome-text',
'name' => __( 'Welcome Text', 'genesis' ),
'description' => __( 'This is the welcome text widget.', 'metro' ),
) );/** Add the welcome text section */
add_action( 'genesis_before_content_sidebar_wrap', 'custom_welcome_text' );
function custom_welcome_text() {
genesis_widget_area( 'welcome-text', array(
'before' => '',
) );
}`And here is the CSS in there now:
`/* Welcome Text WIDGET MY CODE THAT I CANNOT GET TO WORK
------------------------------------------------------------ */.welcome-text {
border-bottom: double #ddd;
border-top: double #ddd;
font-family: 'museo-slab', sans-serif;
font-size: 30px;
line-height: 1.0;
overflow: hidden;
padding: 25px 0;
text-align: center;
}.welcome-text p {
font-size: inherit;
line-height: 1.0;
font-family: 'museo-slab', sans-serif;
margin: 0;
}`
May 5, 2013 at 10:41 am #39393Brad DaltonParticipantThe class for the widget is missing meaning the CSS code Brian also provided will not work as it uses that class
welcome-text
Here's the CSS using the above class which is generated by the PHP code but missing in Kay's code. This is the reason the CSS isn't working.
.welcome-text { border-bottom: double #ddd; border-top: double #ddd; font-family: 'Lora', serif; font-size: 30px; line-height: 1.0; overflow: hidden; padding: 25px 0; text-align: center; } .welcome-text p { font-size: inherit; line-height: 1.0; margin: 0; }
May 5, 2013 at 10:42 am #39394AnitaCKeymasterSend me an email on my website and I will look at your code from here.
Need help with customization or troubleshooting? Reach out to me.
May 5, 2013 at 10:44 am #39395Brad DaltonParticipantYou are still missing part of the code.
That is not the code I pasted as it is missing the new class which the PHP code generates.
You are missing this:
<div class="welcome-text widget-area">
-
AuthorPosts
- The topic ‘Metro theme: adding "Welcome Text" widget per B Gardner's code – help?’ is closed to new replies.