• Resolved frogsy

    (@frogsy)


    Here’s the home page of the blog I’m working with: https://www.centralfloridac12.com. The “Blog” link in the header leads to “?cat=1”, which is correct.

    But on other pages, that Blog link seems to want to be a subpage of the currently displaying page. For example, on /contact/, the Blog link is “/contact/?cat=1”, instead of simple “/?cat=1”. I freely admit that I’m far from a power user of the software, but I’ve looked over the dashboard carefully, and googled a bit, and I’m still not quite sure what’s been done that makes it behave that way.

    If someone can point out where I went wrong and what I might do to remedy this, I’d really appreciate it. Thanks, and my apologies for cluttering the forum with what I’m sure is a dumb problem.

Viewing 6 replies - 1 through 6 (of 6 total)
  • It’s most likely an error in the template. Find the place in your template file where the Blog link is created. Then change the code create the URL to:

    $blog_url = get_bloginfo('url');
    
    echo '<a href="' . $blog_url . '"/?cat=1">Blog</a>';

    That should correct the problem.

    Thread Starter frogsy

    (@frogsy)

    Thanks, Tim, I appreciate the help. But I’ve not quite figured it out yet, do you think you could help me a little further?

    In my header.php file, I think I found the section you’re talking about. It currently reads

    <?php { echo ''; } ?>
                <?php } else { echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>'; } ?>
                <?php if (get_option('artsee_blog_link') == 'Disable') { ?>
                <?php { echo ''; } ?>

    I’ve tried replacing various segments of that with the code you suggest, but I get errors each time. Exactly what should I put in? Or have I found the wrong place? It’s the only place I can find the “get_bloginfo” tag already extant.

    Can you post more of the code, 3-4 lines around(before and after) what’s posted above.

    Thread Starter frogsy

    (@frogsy)

    <!--This controls pages navigation bar-->
    <div id="pages">
        <div id="pages-inside" align="right"> <a href="<?php bloginfo('url'); ?>" class="title" title="Home"><img src="<?php bloginfo('template_directory'); ?>/images/logo-<?php echo $artsee_ebusiness_color; ?>.png" alt="logo" class="logo" /></a>
            <ul class="nav superfish">
                <?php if (get_option('artsee_home_link') == 'Disable') { ?>
                <?php { echo ''; } ?>
                <?php } else { echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>'; } ?>
                <?php if (get_option('artsee_blog_link') == 'Disable') { ?>
                <?php { echo ''; } ?>
                <?php } else { echo '<li class="page_item"><a href="' . $artsee_blog_id . '">' . $artsee_blog_link_text . '</a></li>'; } ?>
                <?php wp_list_pages("sort_order=$artsee_order_page&depth=3&exclude=$artsee_exclude_page&title_li="); ?>
            </ul>

    Hopefully that’s enough to show you. I appreciate the attention and assistance.

    The problem is this area..

    <?php if (get_option('artsee_home_link') == 'Disable') { ?>
                <?php { echo ''; } ?>
                <?php } else { echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>'; } ?>
                <?php if (get_option('artsee_blog_link') == 'Disable') { ?>
                <?php { echo ''; } ?>
                <?php } else { echo '<li class="page_item"><a href="' . $artsee_blog_id . '">' . $artsee_blog_link_text . '</a></li>'; } ?>

    That code is invalid to start with, but regarding the particular problem you have, the problem is with this variable.

    $artsee_blog_id

    If you have set a Blog url in the theme options, go update that URL with a full path… i think the issue is that the url is set to ?cat=4, which needs to be a full path to work correctly.

    Example: https://wwww.youraddress.com/?cat=4

    This doesn’t fix the problem, but i tidied the code for you..

    <!--This controls pages navigation bar-->
    <div id="pages">
        <div id="pages-inside" align="right"> <a href="<?php bloginfo('url'); ?>" class="title" title="Home"><img src="<?php bloginfo('template_directory'); ?>/images/logo-<?php echo $artsee_ebusiness_color; ?>.png" alt="logo" class="logo" /></a>
            <ul class="nav superfish">
                <?php if (get_option('artsee_home_link') && get_option('artsee_home_link') != 'Disable') { ?>
    				<li class="page_item"><a href="<?php echo get_bloginfo('url'); ?>">Home</a></li>
    				<?php } ?>
    				<?php if (get_option('artsee_blog_link') && get_option('artsee_blog_link') != 'Disable') { ?>
    				<li class="page_item"><a href="<?php echo $artsee_blog_id; ?>"><?php echo $artsee_blog_link_text; ?></a></li>
    				<?php } ?>
                <?php wp_list_pages("sort_order=$artsee_order_page&depth=3&exclude=$artsee_exclude_page&title_li="); ?>
            </ul>

    Of course we can do away with $artsee_blog_id if you want, but you’ll then lose the ability to update that URL in the theme options, which i’m assuming you wish to maintain.

    Thread Starter frogsy

    (@frogsy)

    Ah, that does it. Perfect! Thanks a lot, it really helped me out. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Header links oddly malformed on certain pages.’ is closed to new replies.