Static text/banner image before posts in "posts page"
Pardon me if this has already been asked, but I've been searching the forums since yesterday to no avail. I have the Wordpress reading settings option for a "posts page" enabled. It's currently showing a single post at a time on this designated page, and is working well with next/prev navigation for posts therein. The first thing displayed in this "posts page" is the first post's title. How can I add static text/images before the first/only post title that appears on this page?
TIA! |
Are these text/images going to be part of the post? Only on the first post/page (ie if you go to the next post/page you want it gone)?
What version of Atahualpa are you on? What version of Wordpress? |
Sorry for the delay, and thanks very much for the reply.
Atahualpa 3.4, Wordpress 2.8 I would like this static text/banner to appear above every post on my "posts page" -- e.g., it will stay with the page when the visitor hits next/prev. My reasoning behind this is aesthetic, just trying to create a sort of title header for this posts page. It should not be part of the post itself. Hope that clarifies. |
Add it somewhere at Style & Edit CENTER COLUMN -> Content ABOVE the LOOP
|
The "above the loop" inserts seem to put my banner above every page, but I'd like to only have it over my posts page. Is there PHP function which only echoes the text if it's my posts page?
|
you could use the 'is_posts()' function in an if in your code
|
My very late reply! I tried the following in my above the loop content code to no avail (nothing is printed):
<?php if ( is_posts() ) { ?> My banner text <?php } ?> ..Help :) |
Use is_single() for single post pages
|
Flynn and juggledad, thanks for your replies. Still unable to see my banner text here. I wonder if my syntax is wrong? This snippet is the first PHP that appears in the "Content ABOVE the LOOP" box in the "Style & edit CENTER COLUMN" section.
<?php if ( is_single() ) { ?> My banner text <?php } ?> I've also tried replacing "My banner text" with an echo statement. My posts page still shows the post title as the first text on the page. |
what's the url showing an example? this is odd because I just copied your code and I get 'My banner text' as the first thing in the center column.
Make sure that this code is not mixed in with the other code in the "Content ABOVE the LOOP" I put it as the very first thing. Copy the entiry "Content ABOVE the LOOP" and paste it here so I can look at it. |
I reset the Style/Edit Center Column page to defaults, and then re-pasted my echo statement. Still no dice, although I did learn something. When I click on my left navbar link to the single posts page, it does not display "My banner text." However, if I preview a post from within the "Add new post" in WPAdmin interface, "My banner text" does display. It will continue to display as I use Next/Prev navigation to jump between my two example posts.. but when I click on my left nav bar element to go to my posts page, "my banner text" disappears. Hope this sheds some light on this.
Here is my "above the loop" PHP: <?php if ( is_single() ) { ?> My banner text <?php } ?> <?php /* For MULTI post pages if activated at ATO -> Next/Previous Navigation: */ bfa_next_previous_page_links('Top'); ?> <?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */ bfa_next_previous_post_links('Top'); ?> <?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */ if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?> |
Ok, now I see what is happening. Terminology, Terminology, Terminology.
While you might think that if you set the maximum posts to show on a blog page to 1 (dashboard->settings->reading->Blog pages show at most [ ] posts) that the test 'is_single()' would work, but it will not because the blog page is considered a non-single page. Once you jump to the single post pages, then the banner shows up. If you only want the banner to show up on the pages with single posts and you want the banner to show up on the blog page and any of the single pages, you could use HTML Code:
<?php if ( is_single() or is_home() ) { ?> |
How about I want to show an static image above the post on all pages and categories.
please check my blog: http://rayrey.com Kindly help |
Put the image code in 'The contents ABOVE the LOOP'
|
well, thank you it works!
|
All times are GMT -6. The time now is 11:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.