WordPress.org

Ready to get started?Download WordPress

Forums

Matching Page Style to Post Style (16 posts)

  1. mkirkwag
    Member
    Posted 3 years ago #

    Does anyone know what I would need to alter in the style sheet to make the pages match the blog style? I'm creating a static landing page and I'd prefer that it (and all the other pages) had the same style the blog does, rather than a modified version. The site is http://tribeofadmins.com. The theme name is 'Orangy." It does have some obfuscated code, so that my hinder my making the change, but I suspect it's mainly my ignorance of xhtml. Thanks for looking!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Edit your theme's templates files to use the post_class function instead of hard coding the classes 'post' and 'page'. Then style all posts and pages using the generated .hentry class.

  3. mkirkwag
    Member
    Posted 3 years ago #

    Sounds like I'm way over my head. Reading through post_class function didn't enlighten me. I get the very rough idea, but I don't know where to find the place in my style sheet - if it is in my style sheet at all. In Page.php, for example (one of the files the codes says I could use this template tag in) I see code about "post" but nothing that says "page" `<div id="content" class="narrowcolumn">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post_class" id="post-<?php the_ID(); ?>">
    <h2 class="page_title"><?php the_title(); ?></h2>`
    I can't figure out how it's using one style sheet to call up two different styles-but maybe that's normal. In short, I would need to figure out what take out in order to figure out where to put that in, wouldn't I? I tried putting the class="post_class" tag in the one place I found class=page, but to no avail.

    I think I said it in the first sentence, but I have not being able to figure things out :-(

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Try using <div <?php post_class();?> id="post-<?php the_ID(); ?>">

  5. mkirkwag
    Member
    Posted 3 years ago #

    In place of <div class="post_class" id="post-<?php the_ID(); ?>">?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Yes

  7. mkirkwag
    Member
    Posted 3 years ago #

    Nope - no change

  8. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    I'm still not seeing any evidence of the post_class() on your Home page. You need to use:

    <div <?php post_class();?> id="post-<?php the_ID();?>">

  9. mkirkwag
    Member
    Posted 3 years ago #

    I've figured out where in the style sheet this happens. In

    #board_sub{
    	width:100%;
    	height:14px;
    	overflow:hidden;
    	background:url(images/bgr_board_sub.png) no-repeat;

    I changed the image to match the image on the blog/post pages and it worked. Now all I have to do is figure out where to change the spacing so the picture actually fits and I'm golden. Maybe.

  10. mkirkwag
    Member
    Posted 3 years ago #

    YES!!!! I did it! it's all in that "Board" code. I had to make the board_sub match the 1st board on the list.

    Thanks for your help.

  11. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    You're welcome. :-)

  12. mkirkwag
    Member
    Posted 3 years ago #

    You weren't seeing <div <?php post_class();?> id="post-<?php the_ID();?>"> because I removed it when it didn't work. It's undoubtedly the better way to do it, but since I've got this version working...why mess with success, right? :-D

  13. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Oh - I'm a big fan of If It Ain't Broke, Don't Fix It. :-)

  14. miowebdesigns
    Member
    Posted 2 years ago #

    Where is the styling for <div <?php post_class();?> id="post-<?php the_ID();?>">? I don't want it centered and would like to maybe make other tweaks. Is there a hidden style sheet?

  15. miowebdesigns
    Member
    Posted 2 years ago #

    To be more specific, that line puts a heading and the details out there but I want to style just the heading. Where is that magic place? If I add a line to style.css what might it look like?

  16. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    that line just outputs the opening div for the post, with a lot of css classes;

    you would also need to know the html tag of your heading (h2, or h3 or..?) and if it is linked or not.

    for a list of (possible) post_class css class output, see:
    http://codex.wordpress.org/Function_Reference/post_class

    a line for this style.css might look like:

    .hentry h2 { color: green; }
    or
    .hentry h2 a { color: #123edf; }

    (or it could look totally different; details depend on your theme)
    http://www.w3schools.com/css/

Topic Closed

This topic has been closed to new replies.

About this Topic