• Resolved paxnwo

    (@paxnwo)


    this function : wp_list_pages(); lists my pages in this format :

    Pages
    page1
    page2
    page3

    Well , i dont want it to show me the word “Pages“. Instead of “Pages” i want to add an image.

    Image
    page1
    page2
    page3

    I dont know where to edit. I selected the sidebar.php from the editor and there i have <?php wp_list_pages(); ?> but i cannot edit it from there. I want to get rid of “Pages” and use <img src="image.gif"> istead. I think i must edit some other files to make this possible.

    My screenshot explains the problem. I added an image for Categories, one for Search and one for Archive, but i cannot add an image to Pages.

    https://img386.imageshack.us/img386/402/57980632qn0.jpg

    Can you help ? Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Did you already edit the sidebar.php file to add those other images in there?

    The word “Pages” in your screenshot should be just above the <?php wp_list_pages(); ?> in the sidebar.php. Is it not there?

    Can you post the sidebar.php file or give me the URL to it so I can look at it?

    Thread Starter paxnwo

    (@paxnwo)

    well , the word “Pages” isnt there.

    This is the sidebar.php from the theme.

    <!-- begin sidebar -->
    <div id="menu">
    
    <ul>
    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    
    <?php wp_list_pages(); ?>
    
     <li id="categories"><img src="https://www.voievozii.ro/categorii.gif">
    	<ul>
    	<?php wp_list_cats(); ?>
    	</ul>
     </li>
     <li id="search">
       <label for="s"><img src="https://www.voievozii.ro/cauta.gif"></label>
       <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    	<div>
    		<input type="text" name="s" id="s" size="15" /><br />
    		<input type="submit" value="<?php _e('Cauta !'); ?>" />
    	</div>
    	</form>
     </li>
     <li id="archives"><img src="https://www.voievozii.ro/arhiva.gif">
     	<ul>
    	 <?php wp_get_archives('type=monthly'); ?>
     	</ul>
     </li>
    
    <?php endif; ?>
    </ul>
    
    </div>
    <!-- end sidebar -->

    To add an image at the top of your page listing:
    <?php wp_list_pages(‘title_li=’. __(‘<img src=”image.gif”>’)); ?>

    To use a random image :
    <?php
    $tab = array(
    ‘<img src=”image1.gif”>’,
    ‘<img src=”image2.gif”>’,
    ‘<img src=”image3.gif”>’);
    wp_list_pages(‘title_li=’. __($tab[rand(0,2)]));
    ?>

    Thread Starter paxnwo

    (@paxnwo)

    thanks a lot man. i apreciate.

    Woman! arghhh!

    Thanks Roya!

    One more quick question – what if I wanted the image name to be a meta_value for each post instead of a hard coded image name?

    Thanks in advance?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘modifying wp_list_pages() to use image for title’ is closed to new replies.