Forums

Posting Link-Only Posts (8 posts)

  1. jordan8201
    Member
    Posted 2 years ago #

    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:
    http://www.pajamasmedia.com/instapundit/

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

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    There's no minimum limit on post sizes. Just create and publish these one-line posts and you would any other post.

  3. jordan8201
    Member
    Posted 2 years ago #

    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?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    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>

    http://codex.wordpress.org/Template_Tags/in_category

  5. jordan8201
    Member
    Posted 2 years ago #

    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!

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

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

  7. jordan8201
    Member
    Posted 2 years ago #

    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]

  8. jordan8201
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.