Wordpress help

Soldato
Joined
18 Jan 2007
Posts
19,845
Location
Land of the Scots
Not sure if this is possible, but does anyone know of a plugin that will let me put content into a post that only shows when the post is showed on the index page?

For example when someone visits my main page the post will show image A, but when they click read more it will display the whole post minus image A.
 
Don't know of any plugins sorry.

But could you hack the URL to point to a different post, that had the content minus the image?
 
If you're willing to write a small bit of code you could look up the is_home() or is_front_page() functions. I think this might work, I've done something similar to you but I displayed a different header image for different categories and also a different image for the homepage at the same time.

Somewhere in your index.php there should be "the loop". Something like:
Code:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

inside the loop you could do something like:
Code:
if(is_home()){ 
    // do something only for homepage
} else if(is_single()){
    // do something for the individual post
})
 
You could use the "more tag" in wordpress.. It cuts off the post so on the main page the reader has to continue reading..

Also good if you want to condense your posts on the main page.

On the visual tab when writing a post, the button looks like a bit of a4 with a quarter seperated..
 
CSS? Give the image or whatever you want to hide a class. In your standard stylesheet, have something like

Code:
.hide {display: none}
Then either have a stylesheet which is only loaded on the front page, or somehow create a selector which only matches elements on the front page:

Code:
.hide {display: block !important}

A little hacky, but should work.
 
Back
Top Bottom