Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Frontpage only help! (http://forum.bytesforall.com/showthread.php?t=531)

PKM@1LineMedai Feb 24, 2009 03:11 PM

Frontpage only help!
 
I've been trying to look through the forum and use past suggestions but I am hitting a wall!

Our Front page is set to show our latest post in the reading prefs.

What I am trying to do is have something only show up on the first front page, but it is still showing up on everypage

I've tried (likely incorrectly) variations of the following without success
PHP Code:

<?php if ( is_front_page() ) ?>
<?php 
if ( is_home() AND !is_paged() ) ?>
<?php 
if ( is_home() ) ?>

If I need to create a static page for this to work, can I create a page that behaves the same as 'your latest post?'

any help would be fantastic!!

Thanks!
Peter
http://www.1linemedia.com

Flynn Feb 24, 2009 03:30 PM

It looks like you have not set the home page to be a static page (Your Settings -> Reading -> Front page displays: is set to "Your latest posts")

In that case

PHP Code:

<?php if ( is_home() AND !is_paged() ) ?>



should work. Where did you put that code? It should go into index.php, right after
PHP Code:

<?php get_header(); ?>

You also need to close this conditional statement, so you end up with

PHP Code:

<?php get_header(); ?>
<?php 
if ( is_home() AND !is_paged() ) { ?>
Stuff to display only on front page
<?php ?>


Flynn Feb 24, 2009 03:32 PM

You might also want to add a bit of space around the content inside of widgets, now that you've put a border around the widget. You can do that by adding the following to A. Theme Options -> Widgets -> Widget Content Box:

HTML Code:

padding: 5px;

PKM@1LineMedai Feb 24, 2009 03:51 PM

Hey Flynn!

Unfortunately I am getting this error:

Code:

Parse error: parse error, unexpected '}' in /raid4/webraid/home/s/sis/1linemedia/wp-content/themes/atahualpa/index.php on line 16
I'm sure this is something simple, but I only know enough PHP to get myself in trouble, any suggestions?

Peter

PKM@1LineMedai Feb 24, 2009 03:59 PM

I just got it
PHP Code:

<?php get_header(); ?>
<?php 
if ( is_home() AND !is_paged() ) { ?>
Stuff to display only on front page
<?php ?>

not sure if this is functionally correct, but it works!

Thanks!!!
Peter

Flynn Feb 24, 2009 04:04 PM

Sorry, I left out one { in the code above. Fixed now.
Yes, your code in post #5 is correct.

blueprairie Apr 1, 2009 02:04 PM

I would like to do something similar. I want to include (event calendar 3 plugin):

<?php ec3_get_events(999); ?>

on index.php but only have it display on my calendar page.

The page title is: Calendar
The page number is: /?page_id=146

Thanks for the help!

blueprairie Apr 1, 2009 02:12 PM

Also...I'd really like to use this call to only display the calendar items in a certain category...if you happen to know the answer, I'd appreciate the knowledge!

Thanks again!

Flynn Apr 2, 2009 04:22 AM

Only on page with ID 146

PHP Code:

<?php if ( is_page('146') ) { ec3_get_events(999); }  ?>

Only on page with title Calendar

PHP Code:

 <?php if ( is_page('Calendar') ) { ec3_get_events(999); }  ?>

Only in category with ID XX

PHP Code:

 <?php if ( is_category('XX') ) { ec3_get_events(999); }  ?>

Only on single post pages of posts that are filed under category XX

PHP Code:

 <?php if ( is_single() AND in_category('XX') ) { ec3_get_events(999); }  ?>



All times are GMT -6. The time now is 01:22 PM.

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