brianbam — 2013-05-23T01:38:57-04:00 — #1
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?
ralphm — 2013-05-23T05:39:06-04:00 — #2
Just a suggestion, but try replacing those curly quotes around the MainNavication words. I.e. instead of
<font color='"#FF0000"'>R</font><font color='"#FF0000"'>16;</font>MainNavigation<font color='"#FF0000"'>R</font><font color='"#FF0000"'>17;</font>
brianbam — 2013-05-28T23:24:02-04:00 — #3
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
<?php wp_nav_menu( array('menu' => 'MainNavigation' )); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<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>
Why is the code being output that way?
ralphm — 2013-05-29T00:35:29-04:00 — #4
This shows up in the source code of your page:
<p> <?php wp_nav_menu( array('menu' => <font color='"#FF0000"'>R</font><font color='"#FF0000"'>16;</font>MainNavigation<font color='"#FF0000"'>R</font><font color='"#FF0000"'>17;</font> )); ?></p>
You need to address that. No matter what you think you are seeing, that is what you are actually sending to the browser.
brianbam — 2013-05-29T00:44:35-04:00 — #5
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.....?
ralphm — 2013-05-29T00:49:04-04:00 — #6
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.
brianbam — 2013-05-29T00:58:09-04:00 — #7
I don't see the curly braces in the template or in the body content.
ralphm — 2013-05-29T01:04:33-04:00 — #8
Anyhow, as I said, delete the quotes and retype them, just to be sure.
brianbam — 2013-05-29T01:11:40-04:00 — #9
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?
ralphm — 2013-05-29T01:21:41-04:00 — #10
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.
<?php wp_nav_menu( array('menu' => 'CalendarNavigation' ))<font color='"#FF0000"'>;?></font>
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:
<?php wp_nav_menu( array('menu' => 'CalendarNavigation' ))<font color='"#FF0000"'>; ?></font>
brianbam — 2013-05-29T01:27:28-04:00 — #11
I actually did that earlier trying to figure out what the problem is. I fixed it and this issue is just lame :/
ralphm — 2013-05-29T01:47:05-04:00 — #12
Hehe, now there is a gap here that you don't want:
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?
brianbam — 2013-05-29T01:56:24-04:00 — #13
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
ralphm — 2013-05-29T02:13:27-04:00 — #14
Yeah, in the actual browser inspector, this is what appears:
<<font color='"#FF0000"'>!--</font>?php wp_nav_menu(array('menu' =<font color='"#FF0000"'>--></font> ‘CalendarNavigation’ )); ?>
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?
brianbam — 2013-05-30T23:41:22-04:00 — #15
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??
ralphm — 2013-05-31T00:16:06-04:00 — #16
I'm not sure what you mean.
brianbam — 2013-06-01T13:03:31-04:00 — #17
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.
ralphm — 2013-06-02T00:53:09-04:00 — #18
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.