Forums

[resolved] how to limit number of character of a post on front page? (6 posts)

  1. eguru
    Member
    Posted 2 years ago #

    Hello ,
    I am planning to make a autoblogging website with the help of the plugin WP Robot. I tried WP robot on my local server and it is properly fetching the RSS feeds for me. But problem now is that some of the sites allow me to fetch the full content and which I dont want to appear completely on my front page. I was wondering is there any solution which I can clip my (restrict) the number of characters appearing on my front page. Then after if the user click on read more he/ she will be able to see the full post. Mnually I can add <!--more --> where I need a break. But is it possible to do with some tweaks on my theme for auto-blogging?

    Thank you

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

    Use the_excerpt() instead of the_content() in your theme's index.php file.

  3. eguru
    Member
    Posted 2 years ago #

    thax ESMI for ur valuable time

  4. eguru
    Member
    Posted 2 years ago #

    It worked like charm, Esmi. But is there any way I can add "read more" to the excerpt ? thax

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    http://codex.wordpress.org/Template_Tags/the_excerpt#Make_the_.22read_more.22_link_to_the_post

    talks about adding this to your functions.php

    function new_excerpt_more($post) {
    	return '<a href="'. get_permalink($post->ID) . '">' . 'Read More...' . '</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
  6. eguru
    Member
    Posted 2 years ago #

    Thanks a lot RVoodoo.. Yes it is working fine

Topic Closed

This topic has been closed to new replies.

About this Topic