Forums

How often do you need to edit index.php? (12 posts)

  1. Anonymous
    Unregistered
    Posted 7 years ago #

    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.

  2. Mark (podz)
    Support Maven
    Posted 7 years ago #

    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.

  3. plainsman
    Member
    Posted 7 years ago #

    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.

  4. Anonymous
    Unregistered
    Posted 7 years ago #

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

  5. Anonymous
    Unregistered
    Posted 7 years ago #

    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.

  6. coolger
    Member
    Posted 7 years ago #

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

  7. Anonymous
    Unregistered
    Posted 7 years ago #

    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.

  8. Anonymous
    Unregistered
    Posted 7 years ago #

    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?

  9. Anonymous
    Unregistered
    Posted 7 years ago #

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

  10. moshu
    Member
    Posted 7 years ago #

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

  11. moshu
    Member
    Posted 7 years ago #

    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>

  12. Anonymous
    Unregistered
    Posted 7 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.