Community Forums › Forums › Archived Forums › General Discussion › Best way to add a call to action banner to a page ?
- This topic has 12 replies, 4 voices, and was last updated 11 years, 2 months ago by Brad Dalton.
-
AuthorPosts
-
September 10, 2013 at 9:56 pm #61830LoudnessMember
I want to add a call to action banner to many different static page (or articles) on a single website. Same banner on all the pages (banner will roughly be : background pattern, 1 floating image, 2-3 line of text + a button). Using theme Streamline
3 Questions :
1. What is the best way to do that ?
2. Should I just create a new <div> & insert it in each page in the html editor ? Or there would be a better way to do it ?
3. Let's say I want the banner to start at the very begining of the content (no left margin) (while text has a 20px left padding), how can i do that ? Applying a negative margin-left isn't recommended anymore...looking for some pro-tips ! I want to do it the right way ! Thank you !
September 10, 2013 at 10:03 pm #61832nunotmpMemberThe way I would do this is first create a new sidebar with the function
genesis_register_sidebar()
then add an action like soadd_action( 'genesis_before_content', 'wpz_call_to_action' ); function wpz_call_to_action() { if ( is_active_sidebar( 'cta' ) ) { genesis_widget_area( 'cta', array( 'before' => '<div class="cta-wrap">'; 'after' => '<div>'; ) ) } }
You can then use a text widget in the new sidebar you created.
September 11, 2013 at 10:32 am #61952LoudnessMemberThanks for the answer, but I'm looking for a banner at the end of the articles, right under the text, not in a sidebar. (New to php, so I'm assuming your code is for a sidebar banner ?)
September 11, 2013 at 1:45 pm #61996Brad DaltonParticipantYou can hook in the HTML for your banner image directly:
Note. This code uses the old XHTML loop hooks
Or create an after single post widget
http://wpsites.net/web-design/code-after-post-widgets-genesis/
September 11, 2013 at 3:58 pm #62016nunotmpMemberYou can do what I said above and just change the hook to something like
add_action( 'genesis_entry_footer ', 'wpz_call_to_action' );
This will place the widget at the end of every post.
October 18, 2013 at 5:07 pm #67462cybersavvyMemberI'm sure this is the answer I am looking for relating to teh call to action banners I want to be put on pages but I am completely new to Genesis etc. (That's a big etc!) Please treat me gently. 😉
I'm using Executive Pro.
a) @Braddalton with the first code example, do I cut and paste that into the CSS, with my HTML for my banner and that's it?
b) what if I wish to use different banners on different pages according to content eg it might be contact us, Buy now, Download here etc?
c) on this page http://wpsites.net/web-design/code-after-post-widgets-genesis/ it is all about putting a widget after posts. Does this change if it is on pages?
d) I've had a look for tutorials for dummies - does anyone know of any that could help me?!Many thanks
October 18, 2013 at 11:45 pm #67570Brad DaltonParticipanta) Please copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++
Note: You will need to change the hook for HTML 5 child themes http://my.studiopress.com/docs/genesis-loop-hooks-comparison/
b) You will need different code to do that
c) You can hook in widgets anywhere using conditional tags
Please link to your site.
October 19, 2013 at 12:10 am #67574cybersavvyMember1) question - can I find these from the dashboard or do I need to do this via FTP?
the rest require me to go and study much more as I still don't understand hooks.
http://www.webpr.co.uk/express
Many thanks for the prompt reply!
October 19, 2013 at 12:46 am #67581Brad DaltonParticipantSafer to copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++ using FTP or File Manager in cPanel
November 13, 2013 at 7:07 am #72679cybersavvyMemberThis reply has been marked as private.November 13, 2013 at 7:13 am #72681Brad DaltonParticipantNovember 13, 2013 at 7:17 am #72682cybersavvyMemberStill, and publicly, thank you!
November 13, 2013 at 7:33 am #72687Brad DaltonParticipant -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.