Support » Theme: Customizr » Getting a subscribe to button in menu bar

  • Resolved MRM-Racing

    (@mrm-racing)


    I am adding a “Subrcribe to” form element to the right in menubar.

    It can be code or a widget, I am not using the tagline is this a good idea to use that instead?
    Or should I go for adding a new element in header?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Theme Author presscustomizr

    (@nikeo)

    Hi MRM-Racing, this could be a good idea.
    You might want to read the linked snippet to add a button in your WordPress menu.

    Thread Starter MRM-Racing

    (@mrm-racing)

    Thank’s Nikeo, I already have a class for the menus and this is a form code [mc4wp_form] I would like to have at the right in td-header.

    To the left I have brand-logo, menu centered and this piece of code to the right in tc-header.

    /Robert

    Thread Starter MRM-Racing

    (@mrm-racing)

    Thx, I will see what it leads to 🙂

    Thread Starter MRM-Racing

    (@mrm-racing)

    Instead of this code that insert search form;

    add_filter(‘tc_tagline_display’, ‘display_search_box’);
    function display_search_box($html){
    global $wp_current_filter;
    $search_box = get_search_form(false); //don’t echo it
    if ( in_array(‘__navbar’, $wp_current_filter) )
    // replace tagline in portrait viewport
    return ‘<div class=”span7 search-navbar”>’.$search_box.'</div>’;
    else
    // append searchbox to the tagline in mobile viewport
    return str_replace(‘</div>’, $search_box . ‘</div>’, $html);}

    If I would like to insert this short code : [mc4wp_form]

    Any ideas?

    instead of
    $search_box use
    $my_content so
    $my_content= do_shortcode('[mc4wp_form]')

    Thread Starter MRM-Racing

    (@mrm-racing)

    Thank’s for you help so far, i did manage to get it to work with this text just before <header/> code;

    <div class=”subscribe”>
    <?php echo do_shortcode(‘[mc4wp_form]’); ?>
    </div>

    But it seems not so professional with that, how can I mod the code above to use it in functions? It did work when I used $my_content so but it ended up pushing menu down.

    Many thanks for helping me out 🙂

    before the closing tag </header>..
    So there’s one of the wonderful nikeo’s hooks there, and it’s called “__after_navbar”:

    add_action('__after_navbar', 'display_subscription');
    function display_subscription(){
         echo do_shortcode('[mc4wp_form]');
    }

    Should be enough.. Let me know if it’s not 😀

    Thread Starter MRM-Racing

    (@mrm-racing)

    Well it shows up as it should now, will try to get it some css after the eastern dinner now 🙂

    Thank’s
    /Robert

    Thread Starter MRM-Racing

    (@mrm-racing)

    Formatted as I want it!

    Case closed 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Getting a subscribe to button in menu bar’ is closed to new replies.