iLTC Home
Bookmark iLTC!

Categories

Perl
  • Perl Tutorials Beginners

  • Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

  • HTML
  • HTML Tutorials

  • Command Line
  • Command Line Tutorials

  • How Tos
  • Other Tips and Tricks



  • I love the code... dot com
    1716014

    iLoveTheCode.com

    Wordpress - Change the Excerpt Dots to Article Link with Read More Text

    I've been working with a couple of Wordpress 2.7 sites lately.

    I could be wrong, but after perusing the Wordpress Codex, it doesn't seem there is an easy way to make your Archives, Categories, etc. have a customized link to your article. It's just [...], leaving the reader with the responsibility of clicking your title.

    You could pass arguments to the the_content() function, but I believe you then must use the Wordpress <!--more--> tag.

    Too tedious for me when posting.

    So...


    Open the wp-includes/formatting.php

    find:
    edit array_push($words, '[...]');

    change to:
    array_push($words, '[<a href=' . get_permalink() . '>' . 'read more</a>]');

    Save.


    I simply used Wordpress' built-in get_permalink() function to get the url for the post. Wrapped it in a link tag, and we're good to go.

    There may be an easier or speed-friendly way of doing this, but this was my quick and dirty solution.


    Note: I'm not sure the dots [...] are the case with every template, but they are the case in the ones I'm using.


    Resources:
    Wordpress Codex - Customizing the Read More
    Wordpress Codex - the_content() function
    Wordpress Codex - the_excerpt() function

    Related:
    MySQL Wordpress Errors - Can't start server : Bind on unix socket Permission denied


    Previous Article: MySQL Wordpress Errors Can't start server : Bind on unix socket Permission denied
    Next Article: CSS Strikethrough






    Search iLTC w/ Google




    Recent Articles

  • HTML Font Code
  • Javascript and CSS - Easy Pop Up Help Balloons
  • Use OnMouseOver in Javascript
  • Use onMouseOut in Javascript
  • Use innerHTML to Change Text on a Page
  • Renaming a File with Perl's RENAME Function
  • PRINT to Browser with document.write Command in Javascript
  • Passing an Argument or Variable to a Javascript
  • Opening an Alert Box in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • OPEN and WRITE a Data File in Perl
  • OPEN and READ a Data File in Perl
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Javascript Reset Form








  • Perl Programming - Javascript Programming - HTML Code - Mac Unix Command Line - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006-2009 iLoveTheCode.com


    Contact Chris | About this Site


    1715740
    Counter by iLoveTheCode.com


    Last Modified: Saturday, 17-Jan-2009 07:26:18 EST



    Hosted as well :)
    Home-brewed logo - 1997