• 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?

Viewing 9 replies - 1 through 9 (of 9 total)
  • replace the index.php portion of your rewrite rule with the name of your individual archive page file.

    Thread Starter vohiyaar

    (@vohiyaar)

    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.

    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.

    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.

    Thread Starter vohiyaar

    (@vohiyaar)

    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?

    CSS is designed explicitedly to control content.

    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).

    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
    https://www.chait.net ??

    <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 https://www.domain.com/index.php?cat=15 in where have to be placed this url ?
    sorry for bad english

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Individual posts page’ is closed to new replies.