• I would like to have something like this for each entry:
    <div class="post"><b>20 August:</b> News article to go in here. It might just be the first paragraph of the article, with the full article to be read when a person clicks on… Read More</div>
    Is there any easy way to do this – and still retaining the automatic formatting of the post?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Wiki -> Template Tags -> the_time()

    Thread Starter cre8d

    (@cre8d)

    Thanks for the suggestion put knowing the right tag doesn’t solve the problem of it appearing in a new paragraph…

    Actually, it does.
    It’s just that you have to read and learn about the code tags and how to use them. The admin area, and stock index.php are set up the way they are set up.
    that said, you can modify your call to WP to output the links in any way you like:
    [default]call them all in a list with line breaks, and category titles
    call just a specific category
    or any of the other tag options, or derivations of those tags.
    Also, you can put all your links for a specific subject into a category [in the admin section] and then only call those up with the tag <?php wp_get_links(category); ?> on the specified index page.
    so if you use the tag to call them by date and category, and limit the links called, they should appear as you want them to.
    one more thing to think about is the straight code <?php wp_get_links(category); ?> will show up under the default css style of “menu” which very often lacks the pinaché of the internal calls.
    using and attending to “menu ul ul li” and other such css design elements will assist you in making them look nice.
    hope that helps a little more.

    Thread Starter cre8d

    (@cre8d)

    I’m sorry but you lost me there.
    Here’s the basics of what I’m using currently:
    <h2>" title="Full article: <?php the_title(); ?>"><?php the_title();?></h2>
    <?php the_time('n/j/Y'); ?>:
    <?php
    the_content();
    ?>

    I can’t seem to find a different tag to the_content() that allows me to remove the beginning that gets added, so that the date doesn’t appear in a different paragraph…

    I remember others have had similar problems. Since I am not aware of a solution besides hacking the WP core, here’s a crazy suggestion. Perhaps you could use the CSS :after pseudo-element to make the first paragraph disply in line with the date you’re inserting.
    Something like
    .postdate, .postdate:after { display: inline; }
    .postdate { font-weight: bold; }

    and the html would be something like
    <h2>" title="Full article: <?php the_title(); ?>"><?php the_title();?></h2>
    <div class="postdate"><?php the_time('n/j/Y'); ?>:</div>
    <?php
    the_content();
    ?>

    I’m not sure if all browsers support the :after pseudo-element, plus there’s probably a bug somewhere in this code snippet. But you never know, it might work 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Possible to change default formatting to this:’ is closed to new replies.