Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

[SOLVED] Removing Post Footer on Homepage except 1st post


  #1  
Old Oct 27, 2009, 02:49 PM
Larry
 
37 posts · Sep 2009
I got this to work before on:
http://www.topcountrymusicvideos.com/
but I have added the same code to this and it is not working:
http://market-updates.online-stock-trading-guide.com/
any ideas?

Here's the code I added to both based on this thread : http://forum.bytesforall.com/showthread.php?t=3729

<?php
if ( ( is_front_page() AND ($bfa_ata['postcount'] == 1) )
OR ( !is_front_page() ) ) {
bfa_post_footer('<div class="post-footer">','</div>');
} ?>
  #2  
Old Oct 27, 2009, 04:02 PM
juggledad's Avatar
juggledad
 
23,727 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
your front page is not your blog page....

is_front_page()

Description
This Conditional Tag checks if the main page is a posts or a Page. This is a boolean function, meaning it returns either TRUE or FALSE. It returns TRUE when the main blog page is being displayed and the Settings->Reading->Front page displays is set to "Your latest posts", or when is set to "A static page" and the "Front Page" value is the current Page being displayed.

you need to use is_page - see http://codex.wordpress.org/Function_Reference/is_page
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Oct 27, 2009 at 04:07 PM.
  #3  
Old Oct 27, 2009, 07:47 PM
Larry
 
37 posts · Sep 2009
My Front page is my blog page. The link I have in my post above is the front page/blog page.

You probably looked at my nav bars and saw the "Home" page links, which point to the home page for my static site on the main domain, not the blog which is installed on a sub-domain.
  #4  
Old Oct 27, 2009, 07:58 PM
Larry
 
37 posts · Sep 2009
I just noticed that in ATO>Settings>Reading there is no section "Front Page Displays" for this site like in my other site.
  #5  
Old Oct 27, 2009, 08:23 PM
Larry
 
37 posts · Sep 2009
I read through the link at wordpress you pointed me to and I tried using is_home instead of is_front_page and got it to work that way.

Any idea why that is?

And why isn't there the "Front Page Displays" option showing in my admin?
  #6  
Old Oct 27, 2009, 08:30 PM
Larry
 
37 posts · Sep 2009
I found the answer to my one question about why there is no "Front Page Displays" option in my admin section:

Quote:
Front page displays
Use this setting to determine if your posts or a "static" Page displays as your blog's front (main) page. This setting displays only if you have one or more Pages defined.
I don't have any pages set up, that's why.

http://codex.wordpress.org/Reading_Options_SubPanel

Still not sure why is_front_page didn't work in this case though?
  #7  
Old Oct 28, 2009, 04:35 AM
juggledad's Avatar
juggledad
 
23,727 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
I just noticed that in ATO>Settings>Reading there is no section "Front Page Displays" for this site like in my other site
you mean Dashboard->Settings->reading right? What version of WP? That is totally a WP feature/issue. What is on the Reading Settings page?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Oct 28, 2009, 06:22 AM
Larry
 
37 posts · Sep 2009
Quote:
you mean Dashboard->Settings->reading right?
Yes, I do mean that.
I am using Wordpress Version 2.8.5 and Atahualpa Version 3.4.4

I understand it is a Wordpress feature, in my last post above I posted the wordpress url because I realized from your prior comments that you may not have know the "Front Page Displays" option does not show when no "Pages" are set up on the Blog.



I do not have any "pages" set up at all on the Blog. The pages you see are not on the wordpress subdomain at all. My current front page for the blog is a "Posts Blog".
  #9  
Old Oct 28, 2009, 06:32 AM
juggledad's Avatar
juggledad
 
23,727 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Well you learn something new every day!

I just deleted all the pages on my test site, dropped the code in and it works as expected.

?? I just went back to your site and now it seems to be working. What did you do?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Oct 28, 2009, 06:58 AM
Larry
 
37 posts · Sep 2009
I used:

Quote:
<?php
if ( ( is_home() AND ($bfa_ata['postcount'] == 1) )
OR ( !is_home() ) ) {
bfa_post_footer('<div class="post-footer">','</div>');
} ?>
(I mentioned this in my post from yesterday above also...lol)

By using this code, my home/front page is displaying the footer for only the first post as expected but when you go the the next page of posts by using the "older entries" navigation at the bottom of the page the next pages also have the footer on the top post. So is_home is being applied to consecutive pages also, not as expected. It would be better to get it to work using the is_front_page if possible, or is there a way to distinguish the front page using the class somehow?

The current "body" tag on the front page in the source code is showing <body class="blog">,
and the "older entries page" is showing <body class="blog paged paged-2">
  #11  
Old Oct 28, 2009, 07:49 AM
Larry
 
37 posts · Sep 2009
I just added a new "Page" to the site as a Test Page so I could see if the option in
you mean Dashboard->Settings->Reading to "Display Front Page" as: showed up and it did once I added a static page.

I then selected the option to Display the front page as "Posts".

Then I went back and changed the code in:
Appearance->ATO->Style & edit Center Column->The Loop

from:
Quote:
<?php
if ( ( is_home() AND ($bfa_ata['postcount'] == 1) )
OR ( !is_home() ) ) {
bfa_post_footer('<div class="post-footer">','</div>');
} ?>
to:
Quote:
<?php
if ( ( is_front_page() AND ($bfa_ata['postcount'] == 1) )
OR ( !is_front_page() ) ) {
bfa_post_footer('<div class="post-footer">','</div>');
} ?>
Everything worked as expected.

Then I went and deleted the "Test Page" I made, the option at: Dashboard->Settings->Reading to "Display Front Page" disappeared again but the is_front_page code still works. I guess once the code is set up it hard codes it in.
  #12  
Old Oct 28, 2009, 11:06 AM
juggledad's Avatar
juggledad
 
23,727 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
odd that hat should work. I juse changed your original code and added an !is_paged() so the code looks like this
HTML Code:
<?php if ( ( is_front_page() AND ($bfa_ata['postcount'] < 2) AND (!is_paged()) ) 
OR ( !is_front_page() ) ) {
bfa_post_footer('<div class="post-footer">','</div>'); } ?>
and it works fine, the post footer only shows up after the first post on the first page.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #13  
Old Oct 28, 2009, 12:29 PM
Larry
 
37 posts · Sep 2009
Thanks. I made the change and it is working fine now.

I'm learning a lot with all of this reading up!

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Removing Post Footers on Homepage except top post Larry Post-Kicker, -Byline & -Footer 2 Oct 5, 2009 06:14 AM
[SOLVED] How do I make the space between header and 1st post smaller? pilsen1 Header configuration & styling 6 Sep 28, 2009 08:16 PM
Removing Dashed Line Above 1st Post on Single Post Page krystyna Post-Kicker, -Byline & -Footer 2 Aug 27, 2009 05:14 PM
No Spacing Between 1st Post and Sidebar in IE LabbyRoad Atahualpa 3 Wordpress theme 2 May 26, 2009 01:09 PM
Post / Page Info Items - Button crashes comp, how do I add to post-footer? Image help everygirlssecret Post-Kicker, -Byline & -Footer 1 Jan 5, 2009 01:12 PM


All times are GMT -6. The time now is 06:23 AM.


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