Wordpress image


so I am working on my comments.php file and I want to tell Wordpress if I upload an image it needs to post it here:

					<div id="gravatar1" class="grid_2">
						<img src="images/gravatar.png" alt="" />
					</div>	<!-- close #gravatar -->
					<div id="gravatar1" class="grid_2">
					</div>	<!-- close #gravatar -->

for the header only and any other images to post in the entry. how can i do that?

I am not so sure that I get what you mean, but here is what I think could be your solution.

You could use custom fields of a post. You find this option on the add a new post page underneeth the fields for excerpt and trackbacks.

The custom fields option has two fields. Name and Value. You give the custom field a name for example “image” and a value which would be in your image case the url of the image.

Than you enter a piece of code into your theme where you want the image to appear that looks like this.

<img src="<?php $values = get_post_custom_values("image"); echo $values[0]; ?>" alt="<?php the_title(); ?>"/>

You see that the part get_post_custom_values(“image”) includes the name you gave the custom field. In the exampe we gave the custome field the name “image”. If you give the custom field another name make sure the code you enter in your wordpress theme says not “image”.

what i am trying to accomplish is this:


you see how there is an image of Iron Man and some other dude behind him? I will call that the “header image” and I want to have an option in Wordpress that I can select a “header image” that will go to the topic and other images I can embed within the post itself. how can I do that?

Read here at wordpress.org how to insert an image into your post.


again that is NOT what i am asking. I want to set one image to be a header and other images to be inserts. I just need to know what code to use in wordpress to select which image is the “header image”

You have two options. The custom fields option and the image option of the post itself where you upload an image with wordpress media function and choose to insert it in a post. Whether it counts as a post header or not doesn’t matter. One is above the text the other isn’t, but there is no difference in how to do it.

That are the options you have to insert images into a wordpress post or page. If you want the image to be the same for all posts you can also add this into your template file.

Maybe you should make yourself more clear. First you talk about the comment.php and then swing to header and post images.

The iron man example you showed me is a post header. Most likey inserted with the regular image option from wordpress or even the custom fields option.

Maybe someone else can chime in and tell me what I don’t get here.

so what do i have to pinput to get the theme to integrate with the header image?

i am also having two issues:


the “home” icon is aligned incorrectly, how can i fix that?

and the search form is aligned incorrectly.

how can i fix those those two? what information is needed to help provide an explanation? please help!

also this is my current code for the links:

<li class=“page_item page-item-19 current_page_item”><a href=“http://www.adivix.com” title=“”></a></li>
<li class=“page_item page-item-23”><a href=“http://www.adivix.com/blog/” title=“Blog”>Blog</a></li>

<li class=“page_item page-item-2”><a href=“http://www.adivix.com/about/” title=“About Us”>About Us</a>

but i need it to be:

<li><a class=“home” href=“index-2.html”>Home</a></li>

				&lt;li&gt;[B]&lt;a class="current navEffect" [/B]href="blog.html"&gt;Blog&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;[B]&lt;a class="navEffect" [/B]href="portfolio.html"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;[B]&lt;a class="navEffect"[/B] href="about.html"&gt;About Us&lt;/a&gt;

were each link has their own specific category, how can i set that up as well?

If you want a simple post header image all you have to do is insert in image into your post when you write it.

Here I have done this on my testblog. Have a look http://tshirt4you.isgreat.org/wordpress/

All I did is adding an image into my post that had the right size. Done!

The other option you have is the custom field option. The problem with this is, if you have entered the code for the custom field option to your theme for example the single.php or the index.php it will always appear as an image. If you haven’t added a image to this custom field for this post it will show as a broken image. Internet Explorer will show the red cross.

The code you have to enter is above. I gave it to you already, but here again

<img src="<?php $values = get_post_custom_values("image"); echo $values[0]; ?>" alt="<?php the_title(); ?>"/>

Just make sure you replace “image” with the name you give the custom field.

Everything else is up to you. You can also google about wordpress custom fields if you need more info on that.

As for your second problem with the home button. My guess is it is not your css or html that is wrong.

Your home button link appears to be empty what I think is the problem.

Your code:;

<li class="page_item page-item-19"><a href="http://www.adivix.com" title=""></a></li>

The image icon of a home/house is set as a background image. Therefore your have nothing between the <a></a>.

Try to add a empty space like this

<li class="page_item page-item-19"><a href="http://www.adivix.com" title="">&nbsp</a></li>

unfortunately the pages are generated dynamically it isn’t like this:

<li class=“page_item page-item-19”><a href=“http://www.adivix.com” title=“”>&nbsp</a></li>

here is the header.php code


so i got to figure out how to get this code generated dynamically but be able to set them apart.

I see on your page you got it done and it seems to work. One little mistake I have made. The   shouldn’t be visible of course.

replace &nbsp with  
the semikolon should make it right.

i see never thought that would work but what about the link classes?

i still need the link class to say:

<li><a class="home" href="index-2.html">Home</a></li>

but it writes:

<li class="page_item page-item-19"><a href="http://www.adivix.com" title=""></a></li>

how can i do that?

ok here is my question, how can i properly rename the classes in my css to maintain the same behavior as the original html site works?

here is the jqueryslidemenu.css



please help! :frowning:

why you want to rename the classes? Work with the css you’ve got! If you want to make changes to the <ul><li> elements simply change the data for .jqueryslidemenu ul {, .jqueryslidemenu ul li {, in the jqueryslidemenu css file and #topnav ul li in the theme css. You don’t need new classes.

so that’s how i make the css work with the wordpress just like the html works?

i still cannot get this to work how should i setup the css to get this to work? please advise!