Help.. ;-(
-
I have tryed to do what was posted but it doesn’t work?
I want to put a .gif in the side par. I copied this code (< a href=”https://www.thepestcontrolvideo.com” > <img src=”blog/sb.jpg” >< /a >)
into the code in the (sidebar.php) file but the gif does not show up?
Man I hate .php code…. please help
-
The fact that you’re linking to a jpeg might have something to do with it.
That’s not PHP. That’s just a simple misunderstanding of the difference between absolute and relative paths in html. ??
Odds are, there’s not a “blog” directory in your theme directory. I’m guessing your blog is in /blog of your hosting space. so, just change “blog/sb.jpg” to “/blog/sb.jpg” instead and try that.
Also, you don’t actually have the
( )
wrapping your html do you?
You probably should close your img tag to stop problems when you do get the image to show and take out the space between your href and img tags.No I don’t have the () that was just for the post.
Ok I am not sure even what file I should be editing or were the code is for the sidebar? I see a file called side bar but there are two..one in each theme.
I open up the sidebar.php file in the theme I am using in notepad2 but I have NO idea were to put the code? I am not even sure that the code is right for the sidebar to insert the image because I have no clue about edit code.
I am lame to all this and I am just trying to understand, I have read,read and read…..man is hard for me. So please understand how lame I am to this when you are trying to help me…Thanks.
HELP!
Try HTML-Kit (https://www.chami.com/html-kit/) for editing your php files. It colour codes PHP and HTML so it should be easier to see where to put things.
It might be helpful if you posted a little of the surrounding code (1 or 2 lines on each side) so we could see where you’re trying to put the image.
If you want it in the sidebar – you have to edit:
sidebar.php for each theme you want it in.
Do as Maerk suggested or tell us where in the sidebar you want it from your URI.Ok I would like this small .gif to be under the search sign in the side bar. My blog page is https://www.thepestcontrolvideo.com/blog
I want my .gif to link to https://www.thepestcontrolvideo.com
Here is the code for the side bar of the theme I am using.
———————————————————–<div id=”sidebar”>
- <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
- <h2>Author</h2>
A little something about you, the author. Nothing lengthy, just an overview. -
<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
You are currently browsing the archives for the <?php single_cat_title(”); ?> category.<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
You are currently browsing the /”><?php echo bloginfo(‘name’); ?> weblog archives
for the day <?php the_time(‘l, F jS, Y’); ?>.<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
You are currently browsing the /”><?php echo bloginfo(‘name’); ?> weblog archives
for <?php the_time(‘F, Y’); ?>.<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
You are currently browsing the /”><?php echo bloginfo(‘name’); ?> weblog archives
for the year <?php the_time(‘Y’); ?>.<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
You have searched the /”><?php echo bloginfo(‘name’); ?> weblog archives
for ‘<?php echo wp_specialchars($s); ?>’. If you are unable to find anything in these search results, you can try one of these links.<?php /* If this is a monthly archive */ } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?>
You are currently browsing the /”><?php echo bloginfo(‘name’); ?> weblog archives.<?php } ?>
- <h2>Archives</h2>
<!– Author information is disabled per default. Uncomment and fill in your details if you want to use it.
–>
<?php wp_list_pages(‘title_li=<h2>Pages</h2>’ ); ?>
-
<?php wp_get_archives(‘type=monthly’); ?>
- <h2>Categories</h2>
-
<?php wp_list_cats(‘sort_column=name&optioncount=1&hierarchical=0’); ?>
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
<?php get_links_list(); ?>- <h2>Meta</h2>
-
<?php wp_register(); ?>
- <?php wp_loginout(); ?>
- Valid XHTML
- XFN
- WordPress
<?php wp_meta(); ?>
<?php } ?>
</div>
Insert between these 2 lines:
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
I would put the image right before that last
</div>
. That’ll put your image after the “meta” links at the bottom of the sidebar. If you wanted it at the top, you could ut it right after the<div id="sidebar">
.I’d also use the full URL to the image, not a relative one, I find they cause too many errors.
Might I also suggest that you put it in a
<p>
element, like this:<p><a href="https://www.thepestcontrolvideo.com"><img src="www.thepestcontrolvideo.com/blog/sb.jpg" /></a></p>
That should make it align nicely in the theme you’re using.
Ok now we are moving…THANK YOU so much.
Now I can make the .gif the way i want it and place it.
One other thing.
What is the code to center the .gif in the sidebar rather then having it lineup with the other links?
Thank you again.
What do you mean exactly, could you clarify that?
The OP means to centre the picture in the sidebar as opposed to having it aligned left or justified like most themes do sidebars.
The old fashioned way is to add an align=”center” attribute to the img tag which may break validation depending on the doctype, the other and more groovy way is to use something like margin: auto
Ah, I get it now! Change your code to this:
<p id="pestcontrollink"><a href="https://www.thepestcontrolvideo.com"><img src="www.thepestcontrolvideo.com/blog/sb.jpg" /></a></p>
then add this to your stylesheet:
#pestcontrollink { text-align: center; }
You can change “pestcontrollink” to whatever you like.
You did it again…Thank you..
How do you know how to do that?
This stuff boggels me!
How do you make the .gif move down a bit or up a bit?
You could add a little more to the stylesheet. Change:
#pestcontrollink { text-align: center; }
to:
#pestcontrollink {
text-align: center;
padding-top: 10px; }You can play around with how much spacing you want by changing the number — it’s the number of pixels that you want as space at the top.
- The topic ‘Help.. ;-(’ is closed to new replies.