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
  #1  
Old 06-21-2009, 05:55 PM
marksperl marksperl is offline
Registered User
Genesis Member
 
Join Date: Mar 2009
Posts: 36
Default Adding SubCategory to Article title on Home page

On the front page, within the homepageright & homepageleft sections, I am trying to format the article titles to custom display next to the thumbnail. I would like it to be:

<sub-category> -- in one color, ie light blue - and linkable
<article title> -- in other color, ie. dark blue - and linkable
<read more> -- no article summary

similar example is on http://www.huckmagazine.com/

what is the coding on this?

my website it www.groupYnetwork.com
  #2  
Old 06-21-2009, 09:05 PM
SoZo's Avatar
SoZo SoZo is offline
Community Moderator
 
Join Date: Oct 2008
Location: Minneapolis, Minnesota
Posts: 47,500
Default Re: Adding SubCategory to Article title on Home page

You would need to add the category call

<div class="hpfeatured">
<?php $feature_cat_1 = get_option('lifestyle_feature_cat_1'); $feature_cat_1_num = get_option('lifestyle_feature_cat_1_num'); if(!$feature_cat_1) $feature_cat_1 = 1; //setting a default ?>
<h3><?php echo cat_id_to_name($feature_cat_1); ?></h3>



<?php $recent = new WP_Query("cat=".$feature_cat_1."&showposts=".$feat ure_cat_1_num); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
[img]<?php echo get_post_meta($post->ID, [/img]" alt="<?php the_title(); ?>" />
<?php else: ?>
<?php endif; ?>
<?php the_category(', ') ?>: <?php the_title(); ?>

<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>

<?php endwhile; ?>

Read More Posts From This Category

</div>
__________________
John "Nicolas Flamel" Wright | SoZo's design | John Wright Photography

New to Genesis? Check out Genesis Explained.
"We are the music makers, and we are the dreamers of dreams..." - Arthur O'Shaughnessy

"Some days even my lucky rocket ship underpants don't help" - Calvin
StudioPress on Facebook
  #3  
Old 06-22-2009, 04:53 AM
marksperl marksperl is offline
Registered User
Genesis Member
 
Join Date: Mar 2009
Posts: 36
Default Re: Adding SubCategory to Article title on Home page

Perfect, I also added
to break up the line.

Now how do I assign different colors to Sub Category & Article title.

Subcategory (color #5FCBF3)
Title (color #194989)
  #4  
Old 06-22-2009, 05:46 AM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: Adding SubCategory to Article title on Home page

Quote:
Originally Posted by marksperl
Now how do I assign different colors to Sub Category & Article title.
Learn how a CSS id works and add an appropriate id (if needed) so you can select the title or subcategory you are trying to control.

If you cannot find an easy way to select some text, you can use <span> or <div>. <span> is for inline markup and <div> is for blocks of markup.

ie: <span id="subcategory">Some Subcategory Name</span>

Now you can select the subcategory with #subcategory {}.


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
Trouble adding subcategory mortenmost General Discussion 11 07-06-2010 11:45 AM
How to prevent article title from repeating in the article content? -cf General Discussion 3 02-07-2010 01:56 PM
How to have Featured Article or Story on Home Page tonyitaly General Discussion 2 07-28-2009 01:56 PM
Want to add static article post to main home page? jondharr General Discussion 1 02-24-2009 06:24 PM


All times are GMT -5. The time now is 06:55 AM.

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