Viewing 4 replies - 1 through 4 (of 4 total)
  • post_class()
    https://codex.www.ads-software.com/Function_Reference/post_class

    or basic principle to give a post dependant css class to the post title;for example:

    <h3 class="post-title post-title-<?php the_ID(); ?>"><?php the_title?(); ?></h3>

    Specifically using alchymyth’s example the css required to style an individual post title (style.css in your theme):

    /* Different header for pages and posts if post_class() is being used */
    .post h1, .post h2, .post h3 { /* whatever your actual h# tag(s) are */
       font-family: Helvetica;
       color: #111;
    }
    .page h1, .page h2, .page h3 {
       font-family: Georgia;
       color: #111
    }
    
    /* Individual post title by id like in alchymyth's example */
    .post-title-23 {
        font-family: Tahoma;
        color: #222;
    }

    If the post_class is being used then the containing element for each post/page in a loop or on a single/page template will output a variety of useful css selectors you use to customize invidual elements more than you need.

    Hope that helps.

    Thread Starter webmaster in texas

    (@webmaster-in-texas)

    Thank you so very much. I do believe this is what I was looking for.

    If you would please mark this thread as “resolved” it would be appreciated. Helps everyone keep better track of whose issues are still outstanding. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I style headings on each post differently’ is closed to new replies.