Title: How to Add Read More Code in Theme Function
Last modified: August 19, 2016

---

# How to Add Read More Code in Theme Function

 *  [mahaj](https://wordpress.org/support/users/mahaj/)
 * (@mahaj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/how-to-add-read-more-code-in-theme-function/)
 * Hi
 * From last 2 weeks im trying to add a feature as 250 words of post on page appear
   and rest of the article access by Read More Links
 * I have tried Tags and many tutorial but its seems my selected theme is not allowing
   or has bug in it. Alot of search I have found the following code which need to
   be add in function.php
 *     ```
       <?php
   
       add_filter( 'the_content_more_link', 'my_more_link', 10, 2 );
   
       function my_more_link( $more_link, $more_link_text ) {
       	return str_replace( $more_link_text, 'Continue reading &rarr;', $more_link );
       }
   
       ?>
       ```
   
 * Taken from
 * > [http://justintadlock.com/archives/2009/07/01/how-to-filter-a-wordpress-themes-more-link-text](http://justintadlock.com/archives/2009/07/01/how-to-filter-a-wordpress-themes-more-link-text)
 * Here is my theme function Code. Please tell me how to adjust above code into 
   my function.php file.
 *     ```
       <?php
   
       /**
   
        * Coded by misbah (ini_misbah@yahoo.com)
   
        */
   
       if ( function_exists('register_sidebar') ) {
   
       	register_sidebar(array(
   
       		'name' => 'Primary Sidebar',
   
       		'before_widget' => '<li id="%1$s" class="widget">',
   
       		'after_widget' => '</li>',
   
       		'before_title' => '<h4 class="widget-title">',
   
       		'after_title' => '</h4>',
   
       	));
   
       	register_sidebar(array(
   
       		'name' => 'Secondary Sidebar',
   
       		'before_widget' => '<li id="%1$s" class="widget">',
   
       		'after_widget' => '</li>',
   
       		'before_title' => '<h4 class="widget-title">',
   
       		'after_title' => '</h4>',
   
       	));
   
       }
   
       //Check for widgets in widget-ready areas http://wordpress.org/support/topic/190184?replies=7#post-808787
   
       //Thanks to Chaos Kaizer http://blog.kaizeku.com/
   
       function is_sidebar_active( $index = 1){
   
       	$sidebars	= wp_get_sidebars_widgets();
   
       	$key		= (string) 'sidebar-'.$index;
   
       	return (isset($sidebars[$key]));
   
       }
   
       include(TEMPLATEPATH.'/includes/template-options.php');
   
       include(TEMPLATEPATH.'/includes/plugins.php');
   
       /*
   
       add_action('widgets_init', 'remove_default_widgets', 0);
   
       function remove_default_widgets() {
   
       	if (function_exists('unregister_sidebar_widget')) {
   
       		unregister_sidebar_widget('Search');
   
       	}
   
       }
   
       include(TEMPLATEPATH.'/includes/widgets.php');
   
       /**/
       ```
   
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [nglavin](https://wordpress.org/support/users/nglavin/)
 * (@nglavin)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/how-to-add-read-more-code-in-theme-function/#post-1163225)
 * i think what you want is to edit the excerpt ??? try looking for a plugin excerpt
   editor ???? this may help…
 *  Thread Starter [mahaj](https://wordpress.org/support/users/mahaj/)
 * (@mahaj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/how-to-add-read-more-code-in-theme-function/#post-1163247)
 * will it work on version 2.8
 * [http://wordpress.org/extend/plugins/excerpt-editor/](http://wordpress.org/extend/plugins/excerpt-editor/)
 * they said it is for version 2.7….. well i’m trying to install this plugin and
   response back to you
 * Thanks for suggestion
 *  Thread Starter [mahaj](https://wordpress.org/support/users/mahaj/)
 * (@mahaj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/how-to-add-read-more-code-in-theme-function/#post-1163266)
 * Excerpt Plugin is not compatible with wordpress version 2.8
 * any Body knows please or integerate those code into my function.php code 🙁

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to Add Read More Code in Theme Function’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [mahaj](https://wordpress.org/support/users/mahaj/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/how-to-add-read-more-code-in-theme-function/#post-1163266)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
