Support » Plugins » Pages with “more” tag

  • Hey fellow wordpressers,

    I wordpressed a website (sub-urban.org) for a friend from his html+css design. The whole website is built using pages and currently has no posts. However, there are section of the website that could really use the “more” feature (to avoid information overload) that only posts have. And my question is what would you say the best implementation would be?

    I know I could just tell my friend to create a new page with the more content and add a link to it at the bottom of the original page, but I would really like to somehow take advantage of the “more” feature.

    Any help is appreciated.

    Thanks!
    Andrej

    PS. I was thinking about maybe having my friend specify some agreed-upon custom field with a post-slug of a page. That way my theme’s page.php could apply uniform design to all of the “more” links and not rely on him….

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter andrej1c

    (@andrej1c)

    Alright, I figured it out. It would be a lot more elegant (and short) if I was good with preg_match and preg_replace. Also it might mess up the “more” functionality for posts, but hey – the website I made this for has none. If I find time, I might do this the right way. In the meantime…

    1. Insert the “more” tag into your page content
    2. Put this text into let’s say more_for_pages.php, upload into your plugins folder and activate

    /*
    Plugin Name: More for Pages
    Plugin URI: http://www.andrejciho.com
    Description: Lets you use 'More' functionality for pages
    Author: andrej1c
    Version: 1.0
    Author URI: http://www.andrejciho.com/
    */
    function more_for_pages($text) {
      global $_GET;
    
      if (strpos($text, '<span id="more-') != false) {
        $a = explode('<span id="more-',$text);
        if ($_GET['show'] != 'all') {
          return $a[0].'<span id="more">'.
            '<a href="?show=all#more">Click here to read more</a></span>';
        } else {
          $a = explode('<span id="more-',$text);
          return $a[0].'<a name="more"></a><span id="more-'.$a[1];
        }
      } else return $text;
    }
    
    add_filter('the_content', 'more_for_pages');

    Thank you!

    Hi. Your plugin works fine, but I want to know how to display the post in a single post template. I want that “more” tag link to <?php the_permalink() ?>.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pages with “more” tag’ is closed to new replies.