• I would like to know if it is possible to post one line posts that link to other pages. My blog has normal articles, but throughout the day I would like to just add a quick link to another blog that would show up as my most recent blog at the top of the page. An example would be something like this:
    https://www.pajamasmedia.com/instapundit/

    The difference would be that I would write full articles with these in between. Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • There’s no minimum limit on post sizes. Just create and publish these one-line posts and you would any other post.

    Thread Starter jordan8201

    (@jordan8201)

    I understand that, but can I do it without titles as in that site? Or can I have only a Title and have the Title link to the other page?

    Ah – now I understand what you want to do. Give these posts a title as per normal (post without titles are a Bad Idea generally) but I’d suggest filing all of them (and no others) under a very specific catgeory created purely for this purpose.

    Then you’ll need to edit your theme’s index.php file to get the template to identify and treat these post differently based on their category. For example, assuming that the special category is called “Quick Links”, something like this should work:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div <?php post_class() ?>>
    
    <?php if( !in_category('Quick Links') ) :?>
    <h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?></small>
    <?php endif;?>
    
    <div class="entry">
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>
    
    <?php if( !in_category('Quick Links') ) :?>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    <?php endif;?>
    </div>

    https://codex.www.ads-software.com/Template_Tags/in_category

    Thread Starter jordan8201

    (@jordan8201)

    Perfect, thanks! Is there a certain place this needs to be pasted? I tried it at the bottom below the footer, and I got an error when trying to load the page:

    Parse error: syntax error, unexpected $end

    Thanks again!

    You need to amend the Loop in your theme’s index.php file.

    Thread Starter jordan8201

    (@jordan8201)

    Oh ok. This is the code for my index.php. Would you mind helping me figure out where the code should be inserted? Unfortunately, I am not a programmer at all. I hope this is not asking too much.
    My code is below. Thanks!

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter jordan8201

    (@jordan8201)

    Sorry, see code below:
    https://pastebin.com/L20U0bSi

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Posting Link-Only Posts’ is closed to new replies.