• Resolved baymediaarts

    (@baymediaarts)


    I have decided to put logo in sidebar but I get a box with no image and question mark inside it. I also tried using a text widget, with no luck. Here is my current sidebar code;

    <div class="sidebar">
    <img src="url_of/https://www.musicianstelevision.com/wordpress/wp-content/uploads/2009/01/mtn_mulitco_logo.png"
    width="140" height="200" />
    <?php
    /* if the current pages has a parent, i.e. we are on a subpage */
    if ( $post->post_parent) {
    	$parent_title = get_the_title($post->post_parent);
    	$parent_link = get_permalink($post->post_parent);
    	$children = wp_list_pages("title_li=&include=".$post->post_parent."&echo=0");
    // list the parent page
    	$children = wp_list_pages("depth=1&title_li=&child_of=".$post->post_parent."&echo=0");
    // append the list of children pages to the same
    }																							// $children variable
    
    /* else if the current page does not have a parent, i.e. this is a top level page */
    else {
    	$parent_title = get_the_title($post->ID);
    	$children = wp_list_pages("title_li=&include=".$post->ID."&echo=0");
    	$children = wp_list_pages("depth=1&title_li=&child_of=".$post->ID."&echo=0"); // form a list of the children of the current page
    }
    
    if ($children) {
    	echo "<div style='float: right; width: 220px; padding-top: 25px; height: 100%;'>";
            echo "<a href='" . $parent_link . "'>" . $parent_title . "</a>";
    	echo "<ul style='list-style: none; padding-left: 20px;'>";
    	echo $children; /*print list of pages*/
    	echo "</ul>";
    	echo "</div>";
    } ?>
    </div>
    </div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter baymediaarts

    (@baymediaarts)

    website is musicianstelevision.com/wordpress

    Try changing:

    <img src="url_of/https://www.musicianstelevision.com/wordpress/wp-content/uploads/2009/01/mtn_mulitco_logo.png"

    to:

    <img src="https://www.musicianstelevision.com/wordpress/wp-content/uploads/2009/01/mtn_mulitco_logo.png"

    Thread Starter baymediaarts

    (@baymediaarts)

    That worked, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image not showing up in sidebar’ is closed to new replies.