WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Subscription box in Navigation Bar? (28 posts)

  1. ashlilee
    Member
    Posted 2 months ago #

    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!

  2. jmfridey
    Member
    Posted 2 months ago #

    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.

  3. ashlilee
    Member
    Posted 2 months ago #

    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.

  4. jmfridey
    Member
    Posted 2 months ago #

    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.

  5. ashlilee
    Member
    Posted 2 months ago #

    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.

  6. jmfridey
    Member
    Posted 2 months ago #

    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.

  7. ashlilee
    Member
    Posted 2 months ago #

    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??? :(

  8. jmfridey
    Member
    Posted 2 months ago #

    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.

  9. ashlilee
    Member
    Posted 2 months ago #

    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!)

  10. jmfridey
    Member
    Posted 2 months ago #

    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 .

  11. ashlilee
    Member
    Posted 2 months ago #

    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.

  12. jmfridey
    Member
    Posted 2 months ago #

    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.

  13. ashlilee
    Member
    Posted 2 months ago #

    Fantastic! Then if I can just figure out how to remove the related posts I'll be all set. :-)

  14. Andrew
    Forum Moderator
    Posted 2 months ago #

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

  15. ashlilee
    Member
    Posted 2 months ago #

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

  16. Andrew
    Forum Moderator
    Posted 2 months ago #

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

  17. jmfridey
    Member
    Posted 2 months ago #

    Hey Andrew,

    Not a problem, not new to WordPress but a little new to supporting the community :)

    I'll keep with in the guide lines

  18. ashlilee
    Member
    Posted 2 months ago #

    Got it! Ok, now what do I do?

  19. ashlilee
    Member
    Posted 2 months ago #

    Ok, I moved the subscribe widget into the new space but it isn't showing up.

  20. jmfridey
    Member
    Posted 2 months ago #

    Ok great, can you confirm that you now have a new widget area to drop widgets into in your WordPress admin back end?

    If so we need to call that widget area into your theme file.

    From what you showed me we'll need to edit your header.php file.

    Around line 68 you should enter the following code

    <?php dynamic_sidebar( 'inline-nav' ); ?>

    This will be before the </div><!-- .navbar --> section of your theme and after the wp_nav_menu( portion. Do not replace any of the existing code, we'll only be adding :)

  21. ashlilee
    Member
    Posted 2 months ago #

    Done! Now it shows up but it isn't aligned.

  22. jmfridey
    Member
    Posted 2 months ago #

    Okay bare with me, we're going to have to do some CSS to get everything to align right. Let me do a little bit of editing and I should have a resolution for this :)

  23. ashlilee
    Member
    Posted 2 months ago #

    Great. Thanks so much!

  24. esmi
    Forum Moderator
    Posted 2 months ago #

    What theme are you using? Where did you download it from? Are you using a child theme or a custom CSS plugin?

  25. ashlilee
    Member
    Posted 2 months ago #

    The theme I'm using is called Beautiful Day and it's by Idyllic Design Studio.

  26. esmi
    Forum Moderator
    Posted 2 months ago #

    I'm sorry but as you appear to be using a commercial theme, you need to seek support from the theme's developer/vendor. We do not have access to, nor do we support, commercial products here.

  27. ashlilee
    Member
    Posted 2 months ago #

    Oh. I didn't know that either. I guess I won't be back to the forums after this then.

  28. jmfridey
    Member
    Posted 2 months ago #

    Okay, well the rest of this issue will require some simple CSS. As I've started to help Ashlilee with this issue I will finish out this help off the forums. I was not aware that contributing members could not help with general theme issues, commercial or not. This problem is resolved.

Reply

You must log in to post.

About this Topic