WordPress.org

Ready to get started?Download WordPress

Forums

Allow links in posts displayed on homepage (5 posts)

  1. philbonsai
    Member
    Posted 3 years ago #

    Hi

    I have enabled my homepage to display blog posts. Some of the posts however have links, but these are disabled on the homepage. Any way to enable them? I was reading about the "the_content_rss" method and thought changing it would solve my problem, but no luck. It is as follows:

    <?php the_content_rss('', TRUE, '', 37); ?>

    There is supposed to be a fifth parameter, encode_html, that I thought would enable links, but that didn't seem to work either, unless something else went wrong. Any advice would be greatly appreciated.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Your theme may be using <?php the_excerpt();?> instead of <?php the_content();?> in the home page template file. Simply edit the relevant template file and replace <?php the_excerpt();?> with <?php the_content();?>.

  3. philbonsai
    Member
    Posted 3 years ago #

    @esmi,

    Thanks for the response! Unfortunately, I am looking at my theme's index.php file and there is no the_excerpt() usage. Here's the pertinent code for posts:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php post_class(); ?>>
    <?php include("firstimage.php"); ?>
    <?php include("thumbnail.php"); ?>
    <h2 class="posttitle">
         <a href="<?php the_permalink() ?>" rel="bookmark"
         title="Permanent Link to <?php the_title_attribute(); ?>"><?php
         the_title(); ?></a>
    </h2>
    <small class="postMeta">
         <span class="time"><?php the_time('F j, Y') ?></span>
         &nbsp;&nbsp;
         <span class="authorLink">
              <?php the_author_posts_link(); ?>
         </span>
         &nbsp;&nbsp;
         <span class="commentLink">
               <?php comments_popup_link('No Comments', '1 Comment', '%
               Comments'); ?>
         </span>
    </small>
    <p><?php the_content_rss('', TRUE, '', 37); ?> </p>
    <span class="button alignright">
         <a href="<?php the_permalink() ?>">Continue Reading</a>
    </span>

    Thanks for any additional insight.

  4. shail1991
    Member
    Posted 2 years ago #

    @esmi, your advice worked for me, thanks a lot.

  5. shail1991
    Member
    Posted 2 years ago #

    I just found that there are even plugins available to handle excerpt , @philbonsai you can use any of those plugins and see whether it solves the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic