Community Forums › Forums › Archived Forums › Design Tips and Tricks › simple hooks plugin – display on home page only?
Tagged: front page display only, is_front_page, is_home, Simple Hooks
- This topic has 8 replies, 2 voices, and was last updated 11 years, 1 month ago by
tanyaslogos.
-
AuthorPosts
-
February 13, 2014 at 11:04 pm #90217
tanyaslogos
MemberI am using freelance - I want a paragraph of text to display only on the home page.
I can't seem to get it to work no matter what I do it shows on none or all.
this is what I have put into the "genesis before loop" box
<?php is_front_page(); ?> <div style="font-size: 18px;"> <strong style="font-size:20px; font-family: arial;">Welcome to Guatemalan Nativities! </strong> <br /><br /> We offer a variety of custom crafted Nativity Scenes and Ornaments from Guatemala, El Salvador, Mexico, Peru and more! Each of our beautiful products are totally unique as they are hand made by some truly talented artists. These would make lovely gifts to give at Christmas time or to keep and pass down to generations to come.</div><br />
I have php enabled.
I have tried is_home, I have tried it with a colon, with a semi-colon, with the closing php at the end and without. I am at my wits end on why this isn't working.
Anyone got any ideas? Thanks in advance for any insight at to what I am doing wrong.
Sincerely,
https://guatemalannativities.com
TanyaFebruary 14, 2014 at 9:36 am #90303Brad Dalton
ParticipantEasier to add a new widget http://wpsites.net/web-design/adding-new-widget-areas-in-studiopress-themes/
February 14, 2014 at 1:21 pm #90329tanyaslogos
MemberThank you so very much Brad! I tried going that route but failed miserably. I just tried again using your code and still failed. lol
So I must be doing something wrong.
At first I thought the problem was with FREELANCE because it is set up to display widgets depending on your page/post selection in the READING settings on WP but I can't get it to display the widget on ANY page 🙁
Here is the code I have used. It gives me the welcome text box in the widgets area but nothing I put in the box is displaying.
// CODE FOR ADDING NEW WIDGET genesis_register_sidebar( array( 'id' => 'weclome-text', 'name' => __( 'Welcome Text', 'domain' ), 'description' => __( 'Add Welcome Text Here', 'domain' ), ) ); add_action( 'genesis_before_loop', 'your_widget' ); function your_widget() { if ( is_page('about') && is_active_sidebar('welcome-text') ) { genesis_widget_area( 'welcome-text', array( 'before' => '<div class="welcome-text widget-area">', 'after' => '</div>', ) ); } }
I have tried displaying it on the about me page just to make sure it isn't the "home" page that is an issue since I am using a shopp page for the home page. But no matter what I do - it doesn't work.
I wasn't sure what the 'domain' meant so I left it as it was - I also wasn't sure about the 'your_widget' either so I left it be. Do I need to change either of those?
Any and all help would be SOOOOOO appreciated!
February 14, 2014 at 2:04 pm #90337Brad Dalton
ParticipantFebruary 14, 2014 at 3:21 pm #90355tanyaslogos
Memberawe heck. I was hoping you would know why it wasn't working lol
There is really no rhyme or reason as to why it doesn't work except for maybe it's because the wordpress gods hate me.
oh well - back to the drawing board. - Thanks again!
February 14, 2014 at 4:06 pm #90364Brad Dalton
ParticipantDid you try changing this?
'id' => 'weclome-text',
to this:
'id' => 'welcome-text',
February 14, 2014 at 4:22 pm #90369tanyaslogos
MemberI think my eyes must be dying because the before and after you posted look identical to me. lol
February 14, 2014 at 4:27 pm #90371tanyaslogos
MemberGEEZE! i am sorry - i just spotted it. lol will try that
February 14, 2014 at 4:40 pm #90375tanyaslogos
MemberThat was it - thank you again for your help. I think now I need to make an appointment with my optometrist!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.