idealists,
Place something similar ( by simialr I mean add the text and CSS styles needed ) to this code on either your index.php or header.php file, in the location you would like the custom information to appear. This does not need to be within the loop.
<?php if (is_home()) { ?>
<div class="style-name">Hello World, This is the Home Page</div>
<?php } else { ?>
<div class="style-name">Do Nothing</div>
<?php } ?>
Hi doc
Thanks for that
Can the “Hello World, This is the Home Page” text come from a custom page (like the About page)?
So then if one needs to update the content they could do it from within the WP admin environment.
idealists,
Of course this is possible, here is a sample of something you might try. I haven’t fully tried this but it should work. Below we are showing page 7 ( assume this is the About page’s ) title.
<?php if (is_home()) { ?>
<?php $my_query = new WP_Query('page_id=7');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
<h2 class="style-name"><?php the_title(); ?></h2>
<?php endwhile; ?>
</div>
<?php } else { ?>
<div class="style-name">Do Nothing</div>
<?php } ?>
Thanks, I’ll give it a try.
Works a charm, thanks much.
I changed to <?php the_content(); ?> as I wanted the actual post content.
idealists,
No problem, glad we could help.