WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problem: widgets blocks navigation-menu (7 posts)

  1. swedishzeus
    Member
    Posted 3 years ago #

    Hi!
    I am very new to wordpress, but I think I'm starting to get a hang on things. But there is one issue I am struggling with.
    This might be a theme-problem, don't know, but I try here anyway.

    When I try to put an widget in the column where the navigation-menu is, the menu disappears, and get replaced by the widget!

    I have a triple-column design of course with header and footer.
    There are header, footer, index(or page) & right-columns (that's how they are presented in the appearance>editor view) but no left?!? The left one is coded into the header(I dont know if this is an very unusual way to do, but triple column design overall seems to be quite rare as far as I've seen). The navigation menu is in the left column, not an row under the header.

    Well, in the widgets menu, I've got left & right columns to choose between to put widgets in anyway.

    Page can be seen here, with menu; http://www.testservern.se ,that site is my personal for testing purposes.

    I have some php-coding experience, but I can't solve this with my programming skills, I'm not that good, but maybe if someone tells me where the problem is I can solve it by changes in code.

    Is this a known issue?

    Hope for advices!
    /Johan

  2. FishDogFish
    Member
    Posted 3 years ago #

    Hur är du placera widgeten till sidofältet?

  3. Gisha James
    Member
    Posted 3 years ago #

    Which page in your theme calls this menu, is it something similar to left-sidebar.php

    If so post the code of leftsidebar.php here.

  4. swedishzeus
    Member
    Posted 3 years ago #

    In the widgets-menu is both left & right sidebar, so there I can choose where to put the widget. I can see in the code for the header, that the left sidebar is coded into there.
    Here comes some code for the header:
    I widgets-menyn finns både left och right sidebar, så där kan jag välja. Ser i koden för headern, där vänstra sidebar ligger under, att den är kodad in där. bifogar lite kod från sidhuvudet:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title><?php bloginfo('name'); wp_title(); ?></title>
    
        <meta name="description" content="Use no more than 255 characters">
        <meta name="keywords" content="12 unique search terms separated by a comma and space">
        <meta name="copyright" content="Copyright YourCompany - 2008">
        <meta name="author" content="Author: Your Name/Company">
        <meta name="email" content="Email: suppport@yoursite.com">
    
        <meta name="Charset" content="UTF-8">
        <meta name="Distribution" content="Global">
        <meta name="Rating" content="General">
        <meta name="Robots" content="INDEX,FOLLOW">
        <meta name="Revisit-after" content="1 Day">
        <meta name="expires" content="never">
    
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_head(); ?>
    </head>
    
    <body>
    <div id="wrap">
    
    <div id="header" >
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p><strong><?php bloginfo('description'); ?></strong><br/></p>
    </div>
    <img id="frontphoto" src="<?php bloginfo('template_directory'); ?>/img/front.jpg" width="760" height="175" alt="" />
    
    <div id="leftside">
    <p>here I am! i header.php</p>
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Sidebar') ) : else : ?>
    <h2 class="hide">Main menu:</h2>
    <ul class="page">
    <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    </ul>
    <?php endif; ?>
    
    <ul>
    <li>and here 2!</li>
    <li>and here 3!</li>
    </ul>
    </div>

    I have erased code of no importancy, coded by me, due to lack of space here. Here's the piece I think is the problem:
    Jag har raderat ovidkommande, av mig tillagd kod här av utrymmesskäl. Här är delen jag tror krånglar:

    <div id="leftside">
    <p>here I am! i header.php</p>
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Sidebar') ) : else : ?>
    <h2 class="hide">Main menu:</h2>
    <ul class="page">
    <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    </ul>
    <?php endif; ?>

    I have tried to change the order of:
    Jag har försökt byta plats på:

    <div id="leftside">
    <p>here I am! i header.php</p>
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Sidebar') ) : else : ?>

    and
    och

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Sidebar') ) : else : ?>
    <h2 class="hide">Main menu:</h2>
    <ul class="page">
    <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    </ul>
    <?php endif; ?>

    but either it's not possible, or my programming skills is not enough.
    My thought was to put the menu above the place where the widget goes.
    men antingen går det ej, eller så är mina programmeringstalanger otillräckliga. Tanken var att lägga menyn ovanför den del där widgeten lägger sig.
    Very thankful for help!
    Väldigt tacksam för hjälp!

  5. swedishzeus
    Member
    Posted 3 years ago #

    Gisha James:
    It does not seems as i can decide, in the admin menu(which seems strange to me, I am used to other CMS before), where to put the navigation menu, to me it looks like its hardcoded into where it is, i refer to the code in my post above.

  6. Gisha James
    Member
    Posted 3 years ago #

    wp_list_pages('sort_column=menu_order&depth=1&title_li='); shows the menu
    and if ( function_exists('dynamic_sidebar') - shows the widget.

    If you change the order (the way you mentioned), the widget will replace the menu.

    Try to use the code in this way...`
    <h2 class="hide">Main menu:</h2>
    <ul class="page">
    <?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    <li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    </ul>

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Main Sidebar') ) : else : ?>
    <?php endif; ?>`

  7. swedishzeus
    Member
    Posted 3 years ago #

    Well, after some hours of sleep, here was the answer!

    Thanks Gisha James! That solved it!(And made me understand the code a little bit better)

    And, now it's time to mark this thread as solved, I hope I'll find out how to do that...

Topic Closed

This topic has been closed to new replies.

About this Topic