SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    nav won't work in content section

    http://devb.bambl.clients.blinkss.com/schedules/

    As you can see I copied my main nav and tried to put it in the content section of this page. However, it won't work. I actually put it in the template and the content section just to see if I could get it to work outside of the header. It is working in the template, but I'd like to get it to work in the content section.

    Can someone tell me my problem?

    thanks!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Just a suggestion, but try replacing those curly quotes around the MainNavication words. I.e. instead of

    Code:
    ‘MainNavigation’
    do this

    Code:
    'MainNavigation'

  3. #3
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting. The curly brackets don't show in my code when you view the page source. However, my code does not look like this, ‘MainNavigation’


    It looks like this

    <div id="MainNavigation">

    <ul id="MainNav">



    <?php wp_nav_menu( array('menu' => 'MainNavigation' )); ?>



    </ul>



    </div> <!--MainNavigation-->


    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>



    <div class="Calendar">


    [google-calendar-events]


    <iframe src="https://www.google.com/calendar/embed?src=newportsportsclub.yoga%40gmail.com&ctz=America/Denver" style="border: 0" width="1000" height="600" frameborder="0" scrolling="no"></iframe>


    </div> <!--Calendar-->


    Why is the code being output that way?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    This shows up in the source code of your page:

    Code:
    <ul id="MainNav">
    <p>        <?php wp_nav_menu( array('menu' => &#8216;MainNavigation&#8217; )); ?></p>
    </ul>
    You need to address that. No matter what you think you are seeing, that is what you are actually sending to the browser.

  5. #5
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, i know that I'm seeing different code in the text section of my wordpress page. I have no idea where to start when the code that I'm entering is totally different than what's being output.....?

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Check the template where that PHP code resides. I'll wager it looks exactly like what I posted, except that the character references may just appear as curly quotes (e.g. ‘MainNavigation’).

    If nothing else, delete those quote marks and retype them with single quotes.

  7. #7
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see the curly braces in the template or in the body content.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Anyhow, as I said, delete the quotes and retype them, just to be sure.

  9. #9
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried removing the quotes and adding them back. The funny thing is that wordpress is placing <p> tags around the nav code. Why would it do that?

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Ah, that might be a clue to the problem. The system doesn't recognize it as PHP, possibly because there is no gap between the closing ?> and what comes before it.

    Code:
    <?php wp_nav_menu( array('menu' => 'CalendarNavigation' ));?>
    That wasn't the case earlier, I don't think, but anyhow, you might as well add a gap in there and see if it helps:

    Code:
    <?php wp_nav_menu( array('menu' => 'CalendarNavigation' )); ?>

  11. #11
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually did that earlier trying to figure out what the problem is. I fixed it and this issue is just lame :/

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Hehe, now there is a gap here that you don't want:

    Code:
    <? php
    Don't put a gap in there. You want a gap after it, but not between ? and php. Did you do that, or is the system doing this?

  13. #13
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've fixed those. I've copied this code and pasted it from the main nav that is working. Something else must be funky. thx

  14. #14
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Yeah, in the actual browser inspector, this is what appears:

    Code:
     <!--?php wp_nav_menu(array('menu' =--> ‘CalendarNavigation’ )); ?&gt;
    LOL, what a mess. Must be the browser's attempt to make sense of that PHP code that isn't processing.

    Perhaps see if any errors are being output.

    Are you sure "CalendarNavigation" is the right name?

  15. #15
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I copied the main nav code just to test it, then I was going to edit the name for a new nav. Can I repost this somehow so that others see it??

  16. #16
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    I'm not sure what you mean.

  17. #17
    SitePoint Addict
    Join Date
    Aug 2008
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm saying maybe if I post it afresh then maybe others will view it and have a solution. I'm really stumped on why I can't get this to work because I've done it on other websites.

  18. #18
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by BrianBam View Post
    I've done it on other websites.
    In a situation like that, I go through the working version with a fine too comb and compare it with the non-working version until I find the critical difference.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •