[SOLVED] Removing Post Footer on Homepage except 1st post
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>'); } ?> |
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 |
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. |
I just noticed that in ATO>Settings>Reading there is no section "Front Page Displays" for this site like in my other site.
|
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? |
I found the answer to my one question about why there is no "Front Page Displays" option in my admin section:
Quote:
http://codex.wordpress.org/Reading_Options_SubPanel Still not sure why is_front_page didn't work in this case though? |
Quote:
|
Quote:
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. http://market-updates.online-stock-t...g-settings.png 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". |
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? |
I used:
Quote:
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"> |
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:
Quote:
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. |
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()) ) |
Thanks. I made the change and it is working fine now.
I'm learning a lot with all of this reading up! |
All times are GMT -6. The time now is 12:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.