• Resolved swedishzeus

    (@swedishzeus)


    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; https://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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hur ?r du placera widgeten till sidof?ltet?

    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.

    Thread Starter swedishzeus

    (@swedishzeus)

    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" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="https://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: [email protected]">
    
        <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!

    Thread Starter swedishzeus

    (@swedishzeus)

    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.

    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; ?>`

    Thread Starter swedishzeus

    (@swedishzeus)

    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…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem: widgets blocks navigation-menu’ is closed to new replies.