The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Background img in wp_list_pages (4 posts)

  1. silfver
    Posted 10 years ago #


    I have a weird problem.

    In my sidebar.php-template I have this code:
    <?php wp_list_pages('title_li=<h2>' . __('Undersidor') . '</h2>' ); ?>

    And in my header.php-template file i have this code:
    <?php wp_list_pages(); ?>

    In the latest code it only prints out the pages in a
    < li >. Perfect. Exactly as I want it.

    This is how my CSS looks like for the Current item:
    .current_page_item {
    background: url(img/menu-hover.gif) no-repeat bottom;
    font-weight: bold;
    color: #000;

    But in some strange way the background image doesn't show up in the menu in my header, but I can see it in the sidebar template. How come?

    I've tried using a full image link, but it still doesn't show up.

    Any ideas?

  2. silfver
    Posted 10 years ago #

    Hm. Funny. If I add position: absolute; to the CSS the background image appears.

    So it seems to be something wrong with my CSS, I guess.

    Any ideas?

  3. silfver
    Posted 10 years ago #

    I solved it.

    I had to move the $css_class in template-functions-post.php-file.

    Works fine now.

    But if anyone reads this, is it possible to do so I get a code like this instead:

    <li ><a href="link"></a></ li>

    Instead of:

    <li ><a href="link"></a></ li>

  4. krugern
    Posted 10 years ago #

    both lines are the same?

Topic Closed

This topic has been closed to new replies.

About this Topic