WordPress pin text or banner to top of posts?

“WordPress being a CMS, a lot of visitors do NOT visit my Home Page but go straight to a link for one of my posts. I would like to display a message to visitors before any post is displayed not just pin a post to the top of the Home Page – How can this be done?”
I feel a bit silly asking myself a question and then answering it, buy hey it’s what I’m trying to achieve now on this WordPress site so I thought I’d make a post of it…
The reason I would like to do this is because I’m still tweaking the style sheets and features of this website (if you have Flash 8 or above installed you should see the Caspian IT logo animating as an .flv embedded within a .swf that was generated using Adobe After Effects – hope you like it – if you can see it.)
My point is, it’s almost as though I need to display an ‘under construction message – yikes!’. Honestly I really do need to let visitors know this this site is under ‘live’ development and that the stylesheets might go a bit wonkey…
Humm…
Under Construction… however it’s worded it just desn’t seem right.
No, I think I’ve just changed my mind and to just let it go – if the page is wonkey it’s wonky I know that and my visitors know that. I’ve changed my mind, if you haven’t yet then take a look here.
Still Interested?
Ok, that’s because you might want to have a specific banner appear or sales thingy placed above your post so you know you’re always getting a specific message/advertisment across – which is a good thing. It does no harm to get a specific message across does it…
To make this so, you need to start tweaking your single.php file in your themes folder ie (http://yoursite.com/wp-content/themes/your-theme-name/single.php)
I’m using WordPress 2.8.5 (the latest version as of this post)
In the file single.php around line 57 (although this will change from theme to theme) but you’re looking for the logic that displays the post – which goes something like this.
<div>
<div id="maincontent-block">
<!-- Blog Content -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!-- This code added by Simon Nicol 29/10/2009 -->
<?php echo ('Hello there, this text should be at the top of each post'); ?>
The above code is just a test so you can see it working with the right piece of code. The above code could be code to insert Flash, Javascript banners, PHP, text you name it.
For my purpose I just wanted to let my visitors know that my style sheets might be a bit wonky, but on second thoughts I might just put a login box, or RSS feed signup.
All the best
Simon
Related posts:
- WordPress increase number of Recent Posts.
- How To – Add Google custom search to your WordPress blog.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- Google AJAX Translation not working with WordPress & Artisteer
- WordPress’ 20 BEST Plugins for Ultimate Blogging.
- Adding SWFObject to WordPress
- IIRF Drupal, WordPress and IIS6 – How to get them working first time – Guaranteed!
Tags: banner, configuration, posts, wordpress
Leave a Reply
Hot Topics
- Creating a Drupal 6 custom login form – Step by Step tutorial.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- imagecache wrong path – SOLVED!
- 7129/6105195 Edward Leedskalnin’s anti-gravity – How he built Coral Castle.
- How to take Ownership of a Drive, Folder or File in Windows 7
- WordPress widgets not saving or dragging?
- Firefox – update favicon.ico (SOLVED)
- IE emulator for FireFox
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- Access denied – Drupal 6.x
Archives
- November 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- January 2009
- December 2008
- August 2008
- June 2008
