Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Static text/banner image before posts in "posts page" (http://forum.bytesforall.com/showthread.php?t=2268)

verbalicious Jul 5, 2009 05:44 PM

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!

juggledad Jul 6, 2009 06:23 AM

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?

verbalicious Jul 12, 2009 12:11 PM

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.

Flynn Jul 14, 2009 07:50 PM

Add it somewhere at Style & Edit CENTER COLUMN -> Content ABOVE the LOOP

verbalicious Jul 25, 2009 03:10 PM

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?

juggledad Jul 29, 2009 11:39 AM

you could use the 'is_posts()' function in an if in your code

verbalicious Aug 30, 2009 02:50 PM

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 :)

Flynn Aug 31, 2009 10:29 AM

Use is_single() for single post pages

verbalicious Sep 5, 2009 12:55 PM

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.

juggledad Sep 8, 2009 04:24 AM

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.

verbalicious Sep 12, 2009 12:02 PM

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); } ?>

juggledad Sep 15, 2009 09:27 AM

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() ) { ?>

My banner text

<?php } ?>


rayrey Nov 12, 2010 03:59 AM

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

juggledad Nov 12, 2010 05:13 AM

Put the image code in 'The contents ABOVE the LOOP'

rayrey Nov 12, 2010 05:27 AM

well, thank you it works!


All times are GMT -6. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.