Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:27:59+00:00 2026-05-28T15:27:59+00:00

I have this WP Plugin that I want to edit, but I just can’t

  • 0

I have this WP Plugin that I want to edit, but I just can’t figure it out. What this plugin does is it will put a “Read More…” link for each post of the blog page after the first image and the first paragraph. If no image present at the beginning, it will only show the first paragraph and the read more link after that. But I want to make it so that it shows the first 2-3 paragraphs instead of just one. Or even a after the first, say, 300 words. Any help is much appreciated!

  function the_content_with_readmore_link($more_link_text = null, $stripteaser = 0) {
      $content = get_the_content($more_link_text, $stripteaser);
      $content = apply_filters('the_content', $content);
      $content = explode("</p>", $content);


    foreach ($content as $key => $value){

    if  ($value != null || $value != ''){
        if (  !stripos( $content[$key], '<img' )  === false ){
            echo $content[$key];
            for($i = $key+1; $i < count($content); $i++  ){
                echo $content[$i];
                if  ($content[$i] != null || $content[$i] != '') break;
            }
        }
        else{
            for($i = $key; $i < count($content); $i++  ){
                echo $content[$i];
                  if    ($content[$i] != null || $content[$i] !=     '') break;
            }
          } 
          break;                        
      }
      else echo $value;
  }
  echo '&nbsp;<a href="' . get_permalink($post->ID) . '" >Read More ...</a>';
  }
   ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:28:00+00:00Added an answer on May 28, 2026 at 3:28 pm

    Wouldn’t it be easier to just use the “More Tag(1)”?

    There’s a button for it in WordPress when you are editing a post… or, you can use this: <!--more--> wherever you want the “Read More” break to be. The “more” text can be changed to anything you want, as well.

    Just make sure to keep the “more” spot at the beginning, add a space, and then type whatever you want, like this: <!--more But wait, there's more!-->

    Reference:

    1. http://en.support.wordpress.com/splitting-content/more-tag/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a plugin that is loaded by this application.. This plugin calls some
I have been trying to make this to be a little jQuery plugin that
I have this plugin advImage which I use in tinyMce. I want the user
Anyone have experience with this plugin? I have it installed but I have no
I use plugin wp-type, there I can make costum pages, this plugin have function
Again I have a question regarding this plugin: http://t.wits.sg/2008/06/20/jquery-progress-bar-11/ What I want to achieve
I want to edit multiple lines in eclipse, but I can't find any short
I have this code somewhere in my plugin: $('tr', $this).hover(function(){ var cur_color = null;
I have this AJAX submission form written with the jQuery validation plugin. It all
I install plugin open_id_authentication and have this error: /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.