• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Best way to add a call to action banner to a page ?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Best way to add a call to action banner to a page ?

This topic is: not resolved
  • This topic has 12 replies, 4 voices, and was last updated 11 years, 12 months ago by Brad Dalton.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • September 10, 2013 at 9:56 pm #61830
    Loudness
    Member

    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 #61832
    nunotmp
    Member

    The way I would do this is first create a new sidebar with the function genesis_register_sidebar()then add an action like so

    add_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.


    Genesis Child Themes – Follow Me

    September 11, 2013 at 10:32 am #61952
    Loudness
    Member

    Thanks 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 #61996
    Brad Dalton
    Participant

    You 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/


    Tutorials for StudioPress Themes.

    September 11, 2013 at 3:58 pm #62016
    nunotmp
    Member

    You 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.


    Genesis Child Themes – Follow Me

    October 18, 2013 at 5:07 pm #67462
    cybersavvy
    Member

    I'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 #67570
    Brad Dalton
    Participant

    a) 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.


    Tutorials for StudioPress Themes.

    October 19, 2013 at 12:10 am #67574
    cybersavvy
    Member

    1) 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 #67581
    Brad Dalton
    Participant

    Safer 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


    Tutorials for StudioPress Themes.

    November 13, 2013 at 7:07 am #72679
    cybersavvy
    Member
    This reply has been marked as private.
    November 13, 2013 at 7:13 am #72681
    Brad Dalton
    Participant

    Note: Private replies do not work on these forums.


    Tutorials for StudioPress Themes.

    November 13, 2013 at 7:17 am #72682
    cybersavvy
    Member

    Still, and publicly, thank you!

    November 13, 2013 at 7:33 am #72687
    Brad Dalton
    Participant

    You're welcome.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble