Forums

h1 heading for single.php (6 posts)

  1. stoner529
    Member
    Posted 1 year ago #

    I have a featured category.

    I want the features styles for the h1 permalink that i use to show up for the single.php entry title for just the features category. i tried to create a single-features.php but i am not sure how to get the features category to redirect to it because it doesnt seem to do it.

    If tried looking for answers and nothing works. any clues?

    If i change the entry class to my features class it does change the look, but it changes it for every category single post. i just need it for the one particular featured category.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Something like:

    <?php
    if( in_category('n') ) $class = 'featured';
    else $class = '';?>
    <div <?php post_class($class);?>id="post-<?php the_ID();?>">

    in single.php - where n is the id of your featured category - should do the trick.

    You should then be able to use .featured h1 in your stylesheet.

  3. stoner529
    Member
    Posted 1 year ago #

    does that go up at the top or down by that particular area? i have changed $class = featured to the term features since that is the actual class used. believe it or not i couldnt use the permalink feature or featured as the id. it kept giving me errors. so the title is featured but the actual permalink is features go figure. my first go round didnt work on this so i will keep at it.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    does that go up at the top or down by that particular area?

    That really depends upon the structure of your theme's single.php template file but I'd imagine that it would be added near the top of that template file.

  5. stoner529
    Member
    Posted 1 year ago #

    i have gotten that to work now. My next thing will be to get the content to look the same. cant be to hard.

  6. stoner529
    Member
    Posted 1 year ago #

    iv'e gotten that to work. now i am having problems getting the content background to change color like i have it in the category.

Topic Closed

This topic has been closed to new replies.

About this Topic