WordPress.org

Ready to get started?Download WordPress

Forums

Individual posts page (10 posts)

  1. Vohiyaar
    Member
    Posted 10 years ago #

    I am trying to find a way to make the individual posts page look different from the main blog index.php page.
    I have a two column layout for my blog. Now when a viewer clicks on any of my permalinks I want the page that opens up to look different from the main index.php page with a different right column.
    I see that its is the same index.php page that loads up when a permalink is clicked. Its only the post number thats changed as a parameter in the php.
    Any ideas/suggestions?

  2. charle97
    Member
    Posted 10 years ago #

    replace the index.php portion of your rewrite rule with the name of your individual archive page file.

  3. Vohiyaar
    Member
    Posted 10 years ago #

    I think I might have not explained what I wanted to do correctly.
    I want the content of the right column on my weblog to be different when the page for a permalink is opened.
    As opposed to the right column having the same content as on the main index page.

  4. charle97
    Member
    Posted 10 years ago #

    make the new page with the different column. then replace the index.php of the rewrite rule that controls your individual archive pages with the name of the new page.

  5. Alan
    Member
    Posted 10 years ago #

    This is something I've been able to do by switching the style sheet.
    I found on this page near the bottom how to switch the style sheet.
    I copied my style sheet and named it comments.css. All I had to do is then was remove all the CSS formating for that which I didn't want printed to screen and replaced it with "display: none;"

    <style type="text/css" media="screen">
    @import url( <?php echo $siteurl; ?><?php if ($p!="") { echo '/comments.css'; } else { echo '/maniacal.css'; } ?> );
    </style>

    Make sure you don't have any spaces that will mess up the url when you use this code.

  6. Vohiyaar
    Member
    Posted 10 years ago #

    Thanks charles,
    I think I got you the second time. Interesting how each one of us had to repeat what they said twice for me to understand! :-)
    Am I slow or am I slow?
    I'll try this out.
    Alan,
    Changing the look, yes, but is changing the CSS a good way to control content?

  7. Anonymous
    Unregistered
    Posted 10 years ago #

    CSS is designed explicitedly to control content.

  8. Alan
    Member
    Posted 10 years ago #

    It's the path of least resistance. It's important to know when switching the stylesheet that in actuality both the main blog html source file and the single entry html source file will include the content for both pages...what's displayed is determined by the CSS display mode. So, the total sidebar ASCII that's being transferred should weigh into your solution. For me, I'm not displaying anything additional in my sidebar on the comment page. So I don’t think the total file size will slow down my site.....though, I may change that down the line (I'm still working on my site).

  9. davidchait
    Member
    Posted 10 years ago #

    Vohiyaar -
    There's two pieces to this. On my site (www.chait.net), they base off testing a variable I call $onepost, which for all intents is set to:
    $onepost = empty($p);
    First, physically output a different set of sidebar content based on whether or not your on a 'one-post' page. This can be the entire sidebar changing, or showing/hiding individual block elements. Again, look at my site and see what changes when you go from a list view to a single post.
    Second, you can add a 'onepost' div around the post div when $onepost is true. That allows you to optionally adjust the CSS/look/layout of a single post page. Again, look at my site and the change in page style (it's somewhat subtle, but you should figure it out).
    -d
    http://www.chait.net ;)

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    <style type="text/css" media="screen">
    @import url( <?php echo $siteurl; ?><?php if ($p!="") { echo '/comments.css'; } else { echo '/maniacal.css'; } ?> );
    </style>
    Alan for example I wanna change look http://www.domain.com/index.php?cat=15 in where have to be placed this url ?
    sorry for bad english

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.