Support » Fixing WordPress » How often do you need to edit index.php?

  • Just wondering how much of the layout resides in editing index.php . . .or is it all in the layout.css?
    For example, I want to move the date/time in with the post title . . .but I’m not sure how to do it exactly.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Mark (podz)

    (@podz)

    Support Maven

    That’s in index.php.
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    h3 is the title part, the meta is the rest.

    Well, I’m sure others will comment, but I’ll give your question a try.
    I believe that in most cases the ‘time’ is located in
    <?php the_author() ?> @ <?php the_time() ?>
    you can move that around with ease – provided you keep in the same ‘context’ – as in, inside a ‘div class’ argument … or class=”storytitle”, etc.
    I had to play with it at the beginning to find ways that worked.
    One tip … SAVE A BACK UP COPY of your index.php before starting. *grin* :o) Put it in notepad, for instance, to paste back in when it doesn’t work.
    Good luck.

    So I would “move” stuff in index? Not layout.css?

    Yeah, I’m not a total website or IT noob, just when it comes to CSS and PHP and WP.
    Thanks. I figured that’s what I was looking at, just not sure where I should be moving what exact code to. Lots of trial and error I guess.

    Yes, index.php determines what and where your elements should be shown, and xxx.css just tells the browser how they look like.

    Ok, just for fun I tried moving
    @ <?php the_time() ?>
    up to
    <?php the_date(”,'<h2>’,'</h2>’); ?>
    so it read
    <?php the_date(”,'<h2>’,'</h2>’); ?> @ <?php the_time() ?>
    and I got an error.
    So THAT’s not gonna work.

    Ok, so I don’t know what I did different, but I did the same as above and it works . . .sorta.
    Now the time is below the date (which is in a table with a background), but it is unformatted. I want it in the table with the date. The date doesn’t seem to have any “div” or “class” other than content though.
    Any thoughts?

    Also tried putting
    ”,'<h2>’,'</h2>’
    in the time variable. Still no formatting.

    Because the variables for the the_time tag and the_date tag are not the same.

    P.S. I was thinking about a workaround…
    If you want the same formatting for the date and time obviously this one wouldn’t work
    <?php the_date('','<h2>','</h2>'); ?> <h2>@ <?php the_time() ?></h2>
    since the two heading (h2) tags would force a line break and a huge white space…
    so the not-so-elegant but efficient 🙂 way would be:
    <h2> <?php the_date(); ?> @ <?php the_time() ?></h2>

    Cool. Worked perfect. Thanks (should thought of that).

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How often do you need to edit index.php?’ is closed to new replies.