WordPress.org

Support

Support » Themes and Templates » [Resolved] Subscription box in Navigation Bar?

[Resolved] Subscription box in Navigation Bar?

  • Hi there!

    I’d really love to have my subscription box on the right side of my navigation bar but I can’t figure out where to put the code to do it. The subscription box is currently in my sidebar (it’s mailchimp) but I’d rather have it on the right of my sidebar.

    Can anyone help?

    http://www.foreverashley.com/

    Thanks so much! You CSS people are amazing!

Viewing 15 replies - 1 through 15 (of 27 total)
  • Are you referring to the “Follow by Email” section on your side bar?

    How much of that would you like to be in the navigation?

    Putting it in your navigation as is will severely change the way your navigation bar looks by height.

    Did you want a hover over drop down box or did you want the email form to be inline with your navigation?

    We’ll need more details to help you out with this issue.

    Thanks for replying. I’m working on a few changes right now but all I really want is the box to enter the e-mail address and a subscribe button. Nothing else needs to be there. I’d rather it be inline with my navigation.

    I can adjust the other pages and items that appear in the navigation bar. I’m working on that right now anyway and redesigning the menu.

    Okay, i’ll explain the direction I think you can obtain this easily then. I don’t know how much experience you have with modifying WordPress themes so you’ll have to let me know how much of this you understand.

    Knowledge of the following would help to do this yourself.

    HTML
    CSS
    PHP
    WordPress API

    So here’s what I would do.

    Assuming your “Follow by Email” section is a widget, I would create a new widget location. Insert this widget location with an HTML div to the right of your navigation bar, you’ll need to use CSS display: inline-block to achieve this.

    In your widget section you’ll then be able to drag the widget over to your new widget location.

    Use CSS to style your “Follow by Email” widget by hiding the Email Address text and float or inline the “Yay!” button.

    This should give you the results you’re looking for.

    Please let me know how much of this makes sense to you, I can explain this in more detail if need be.

    Hi again,

    That’s pretty much greek to me. I mean, I understand the idea but I don’t know how to execute it. I understand what you mean by create a new widget location but I don’t know how to do it.

    You’re very kind to help me out. I appreciate it very much.

    Hi Ashlilee,

    Sorry about the delay here. Let’s begin by creating a new widget location.

    In your function.php you probably already have a register_sidebar section started that you can add on to. The proper way to add a new widget area is by placing the following code in your function.php file.

    if ( function_exists('register_sidebar') ) {
        register_sidebar(array(
            'name'=> 'Nav Widgets',
    	'id' => 'nav_widgets',
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h5 class="widgettitle">',
            'after_title' => '</h5>',
        ));
    }

    If the function_exists(‘register_sidebar’) already exists in your function.php file you can simply add on to that by just placing the following code inside your IF clause.

    register_sidebar(array(
            'name'=> 'Nav Widgets',
    	'id' => 'nav_widgets',
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h5 class="widgettitle">',
            'after_title' => '</h5>',
        ));

    After you’ve added this code to function.php you should be able to see a new area in your Widgets backend where you drag your subscription widget into.

    Lets start there and i’ll help you with the rest once this is successful.

    Oh NO!!! Ok, so I copy / pasted the first part in where I thought it needed to go and I hit a button but now…IT’S GONE. All of it. I can’t even get back into my admin to fix it or delete that part.

    Boom! GONE.

    What do I do??? 🙁

    Okay, it looks like you may have pasted it in the incorrect location or possibly in the process of pasting, deleted something that was required.

    The error is coming from your functions.php file on line 135.

    At this point you’ll probably need to edit your functions.php file manually through FTP or restore a backup of your functions.php file, that is if you have one.

    Thanks. Believe it or not I actually thought that so I’m in my FTP files right now trying to find it and remove it.

    Stand by…

    (and thanks!)

    If you need to send me a copy of your function.php file please do so at [Email redacted]

    Please keep communication through this post so we can possibly help others .

    Ok, I have the site back up (I had to access the FTP files through my host server, open the function.php file and edit the code there. If not, I could have just deleted the file and uploaded the functions.php file again since I still had the original (thank God I did that).

    I emailed you my function.php file. I obviously have no idea what I’m doing.

    Not a problem.

    I’ll modify your functions.php file and input comments that you may delete. This should give you a better idea of what needs to be done so you can modify this yourself in the future.

    Fantastic! Then if I can just figure out how to remove the related posts I’ll be all set. 🙂

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    @jmfridey, In future please do not ask people to contact you. If you wanted the contents of a file you could ask the original poster to share it via PasteBin. If the issue was that the original poster didn’t want it to be public then that is a drawback for them, as these are public forums.

    Aww he didn’t want the contents of the file, he was just offering since I’m such an idiot with this stuff. He did ask that we keep all communications here so others could be helped through the forum. I didn’t mind sharing the contents here; wasn’t aware of the rule. Thanks for clarifying. 🙂

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Yes, we do appreciate the support he gave and is going to continue to give to you 🙂

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘[Resolved] Subscription box in Navigation Bar?’ is closed to new replies.