Support » Fixing WordPress » add a line to each new article

  • Is there way i can add a adjustable line to each article?

    Basically all my articles start with this line:

    <p align=”right”>Source: —- </p>
    these —- should be adjustable offcourse to what my source was. The enters are there cause that way it looks prettier.

    Now i have to manually type this but is there a way when i click on ‘New article’ that this line is already in place?

    Or like add a button when i click on it that piece of text is placed in the article?
    Something like that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • small corrections the line of text isn’t entirely right
    it should be <br/><br/><p align="right"><strong>Source:</strong> ----</p>

    It got changed cause i forgot the code tags.

    anybody? basically like in this forum that in the message text field there is a pre-written line of tekst basically the above HTML code? Someone who can help me, please?

    If I understand correctly, you’re best off using custom fields.

    Create a new custom field below the content editor called Source.

    Then, above the_content(); function in your template, add:

    $source = get_post_meta( $post->ID, "Source", true);
    if( $source ) {
      echo( '<br /><br /><p class="source">Source: ' . esc_html( $source ) . '</p>');

    etc etc.

    Note I removed the inline alignment. Use a class instead, and apply the right align and bold to p.source instead. This makes future revisions more universal.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add a line to each new article’ is closed to new replies.