StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-15-2009, 08:00 PM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: Displaying different catagories

Quote:
Originally Posted by parker3773
I have two questions
It is usually best to limit one question to a topic.


Quote:
Originally Posted by parker3773
1.) Is there a way to highlight the newest blog entry on the home page? I would like to make the first post a little larger than the others.
I can think of several ways. You could add a counter to the PHP code. On the first pass of the Loop, add an id to the post called "first-post". Then increment the counter.

Read more about The Loop.


In home.php somewhere outside the Loop, like under the "<!--This is where ..." comment add the counter:
Code:
<?php $post_counter = 1; ?>
Inside the Loop, replace:
Code:
<?php the_content_limit(400, "[Read more]"); ?>
with this:
Code:
<?php if ( $post_counter == 1 ) :
	<div id="first-post">
		<?php the_content_limit(400, "[Read more]"); ?>
	</div>
	<?php $post_counter++; ?>
<?php else: ?>
	<?php the_content_limit(400, "[Read more]"); ?>
<?php endif; ?>
In style.css add a section for the first-post id and style to your hearts content.


Quote:
Originally Posted by parker3773
2.) Rather than posting the last 5 posts in the same topic, I would like to post the first 2 in different topics. How do I do that?
That's going to require a few checks and a bit of programming logic. You will need to know how The Loop works and how to use query_posts(). query_posts() and WP_Query() use the same parameters, but there is no page for WP_Query. Look at the "offset" and "showposts" examples for a clues on how to get just one post and how to skip it later.

If all this is over your head consider using a StudioPress Approved Designer.


HTH,
__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
 

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Catagories. Godfather General Discussion 3 02-23-2010 03:38 PM
Catagories not showing up rueschhoff General Discussion 4 09-28-2009 08:50 AM
Catagories DuaneMIS General Discussion 3 08-21-2009 07:27 PM
Sub catagories Drew General Discussion 1 07-28-2009 09:53 PM


All times are GMT -5. The time now is 02:01 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.