Irish SEO,  Marketing & Webmaster Discussion
 
Affiliates get Paid On Results, Click Here!
 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Webmaster Discussion > Blogs & Blogging


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16-08-2007, 09:53 PM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,171
Cormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to behold
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Default WP Front Page Moficiations

Hi,
Does anyone know of a resource which will provide me with the necessary code to modify the presentation of my blog's homepage? I'm trying to give Wordpress more of a CMS feel to it and I want the homepage to be a type of splash page.

On the homepage I would have:
The most recent post in full
Post 2,3,4,5 display as excerpts with a 'read more' link
The 5 most recent comments displayed within the main content area (not within the sidebar)
And a few other items..

In pseudocode terms the design would be"
Code:
if user is on the homepage{
display x,y,z within main-content div and drop the sidebar }
if user is on a single post {
display the post's content and place a sidebar to the right
__________________
my blog | Apple Mac Blog | Indie Music Blog | *
Reply With Quote
  #2 (permalink)  
Old 17-08-2007, 09:38 AM
paul's Avatar
Web Whore
 
Join Date: Dec 2006
Location: .de
Posts: 950
paul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud of
Default

Cormac there is an option to have a certain page (rather than post) be displayed on the index.php go to here Cormac Moylan › Login

Then you could get the execphp.php plugin to grab the last five posts via the wordpress Codex.

I've been doing a fair bit of playing with Wordpress and it's amazing what it can do.
__________________
my sites :
irish poker / irish jobs / seo faq / advertise jobs free / green card / skiing
Reply With Quote
  #3 (permalink)  
Old 17-08-2007, 01:56 PM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,171
Cormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to behold
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Default

Hi Paul,
I knew that you could set a static homepage using a page but I wasn't aware of the execphp.php plugin. That's the type of thing I'm looking for.

Hemingway - Hemingway - Warpspire - has a modified homepage which is kind of similar to what I want to achieve.
__________________
my blog | Apple Mac Blog | Indie Music Blog | *
Reply With Quote
  #4 (permalink)  
Old 17-08-2007, 08:38 PM
Frontpage User
 
Join Date: Aug 2007
Posts: 7
alexleonard is a jewel in the roughalexleonard is a jewel in the roughalexleonard is a jewel in the roughalexleonard is a jewel in the rough
Send a message via Skype™ to alexleonard
Default

I would suggest that you don't necessarily need the execphp plugin. It's handy, but I've found it to be buggy at times, and it can also clash with some of the XHTML correction from the TinyMCE plugin.

I would suggest that it might be worth making these kind of alterations within your theme. It gives you more control and you won't bash your head off the keyboard when things aren't working right.

On our website I have set the home page as a static page, therefore using the "page.php" file as per the template hierarchy used in Word Press.

I wanted to display our most recent portfolio item, and the method done to achieve this is the same as what you are looking for. Here's the code that I've dropped into my page.php template file and I'll break it down below.

Code:
<?php if (is_page('4')) { ?>
<h1 class="hright">Recent Work</h1>
<?php query_posts('cat=8&show_posts=1&posts_per_page=1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post-wrap home-portfolio" id="post-<?php the_ID(); ?>">
    <h3 class="post-title"><?php the_title(); ?></h3>
        <div class="story-content">
        <?php the_content('Continue Reading &raquo;'); ?>
        <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
        </div><!-- end post content -->
</div><!-- end post -->
<?php endwhile; endif;  
} // end if is_page 4! ?>
So, as my page ID is "4", I have said if the page is page 4 show 1 post from category 8 (which is our portfolio category) after the beginning of "The Loop" we get the display of the_title and the_content.

In your case, you'll need to start the same if (is_page('x')), which you'll need to follow with 2 or 3 uses of the loop.

The first loop use will probably look like:
Code:
<?php query_posts('show_posts=1&posts_per_page=1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content('Continue Reading &raquo;'); ?>
With the second loop looking like:

Code:
<?php query_posts('show_posts=5&posts_per_page=1'); ?>
 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_excerpt('Continue Reading &raquo;'); ?>
Now, I'm being a little rough here, but hopefully you catch my drift. Obviously the excerpt usage would need to exclude the most recent post as that is being reproduced in full. There are ways of doing this explained fully in the codex.

Comments can be a good laugh. I've found that the inbuilt word press comment fetching is a little basic for my HTML structural desires. I've been using the Get Recent Comments plugin to help with this.

Dropping the sidebar can be done easily as well using if statements.

To give a full picture, here's a condensed version of my page.php file:

Code:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  <div id="post-<?php the_ID(); ?>">
   <?php the_content(); ?>
  </div><!-- end post -->
<?php endwhile; else: ?>
 <h2 class="title"><?php _e('Not Found'); ?></h2>
 <p><?php _e("Sorry, but the page you're looking for couldn't be found. Double check your URL or you should try searching for it."); ?></p>
<?php endif; ?>

<?php if (is_page('4')) { ?>
<h1 class="hright">Recent Work</h1>
<?php query_posts('cat=8&show_posts=1&posts_per_page=1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>">
   <h3 class="post-title"><?php the_title(); ?></h3>
    <?php the_content('Continue Reading &raquo;'); ?>
</div><!-- end post -->
<?php endwhile; endif;  
} // end if is_page 4! ?>

<!-- Begin Sidebar -->
<?php 
include(TEMPLATEPATH . '/sidebar-page.php'); 
?>

<?php get_footer(); ?>
Reply With Quote
  #5 (permalink)  
Old 17-08-2007, 09:18 PM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,171
Cormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to behold
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Thumbs up

Cheers Alex,
That's a fairly detailed explanation.
I'll take some thought from the code you supplied and I'll check out the Codex further too.
__________________
my blog | Apple Mac Blog | Indie Music Blog | *
Reply With Quote
  #6 (permalink)  
Old 17-08-2007, 09:22 PM
Frontpage User
 
Join Date: Aug 2007
Posts: 7
alexleonard is a jewel in the roughalexleonard is a jewel in the roughalexleonard is a jewel in the roughalexleonard is a jewel in the rough
Send a message via Skype™ to alexleonard
Default

Aye. There's quite a bit of customisation you can do...

The codex is nearly brilliant.. I've spent so much time on there over the last while and it's nearly always sorted me out (with a little help from the forums).

Definitely loving the word press thing though. It's fantastic.
__________________
Business Site, Personal Blog, Music Persona!
Reply With Quote
  #7 (permalink)  
Old 18-08-2007, 04:20 PM
paul's Avatar
Web Whore
 
Join Date: Dec 2006
Location: .de
Posts: 950
paul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud of
Default

That's a great post Alex, nice tips !
__________________
my sites :
irish poker / irish jobs / seo faq / advertise jobs free / green card / skiing
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"No page rank info availible" lix1 Google 8 06-03-2008 04:49 PM
Successful Site in 12 Months with Google Alone montyauto Webmaster Articles 11 18-02-2008 12:28 PM
Crazy irrelevant ads on one page 404 username not found Google Adsense 4 12-06-2007 07:53 PM
Page Exit / logout Frodo Coding Help 5 14-03-2007 12:07 PM
Want to front page Digg and Slashdot? Get hacked. gary.b Webmaster Discussion 6 17-01-2007 03:31 PM


All times are GMT +1. The time now is 10:38 PM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56