Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   [SOLVED] Removing Post Footer on Homepage except 1st post (http://forum.bytesforall.com/showthread.php?t=4093)

Larry Oct 27, 2009 02:49 PM

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

juggledad Oct 27, 2009 04:02 PM

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

Larry Oct 27, 2009 07:47 PM

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.

Larry Oct 27, 2009 07:58 PM

I just noticed that in ATO>Settings>Reading there is no section "Front Page Displays" for this site like in my other site.

Larry Oct 27, 2009 08:23 PM

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?

Larry Oct 27, 2009 08:30 PM

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?

juggledad Oct 28, 2009 04:35 AM

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?

Larry Oct 28, 2009 06:22 AM

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.

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".

juggledad Oct 28, 2009 06:32 AM

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?

Larry Oct 28, 2009 06:58 AM

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">

Larry Oct 28, 2009 07:49 AM

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.

juggledad Oct 28, 2009 11:06 AM

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.

Larry Oct 28, 2009 12:29 PM

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.