Title: Hook into Services section
Last modified: February 8, 2018

---

# Hook into Services section

 *  Resolved [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/hook-into-services-section/)
 * Hi,
 * Because I don’t want to display a summary (excerpt) in the Services section (
   but all content) I was thinking about creating a mini-plugin that contains a 
   function that hooks into this section, so I can create a customized excerpt.
 * Does your theme include a function I can hook into?
 * Example:
 *     ```
       if (onepress_services_section) {
         // do stuf
       }
       ```
   
 * Thanks in advance!
 * Guido

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

 *  Theme Author [FameThemes](https://wordpress.org/support/users/famethemes/)
 * (@famethemes)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/hook-into-services-section/#post-9953040)
 * Hi [@guido07111975](https://wordpress.org/support/users/guido07111975/),
 * Please do the following here:
 * [http://docs.famethemes.com/article/57-how-to-change-wordpress-page-excerpt-content](http://docs.famethemes.com/article/57-how-to-change-wordpress-page-excerpt-content)
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/hook-into-services-section/#post-9953265)
 * Hi,
 * Thanks for your response.
 * Not useful for me because the excerpt strips all HMTL markup as well.
 * Guido
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/hook-into-services-section/#post-9954640)
 * Update:
 * This does work because the custom page excerpt does NOT strip all HTML markup…
   great, thanks.
 * But I also found a simple solution to hook into the default excerpt, and change
   that into all content for the pages that are listed in Services section. In my
   example page with ID 22 and 369:
 *     ```
       function onepress_excerpt( $excerpt ) { 
       	$page_id = get_the_ID();
       	if($page_id == 22 || $page_id == 369) {
       		// get post content
       		$post = get_post( get_the_ID() );
       		$post_content = wpautop( wp_kses_post( $post->post_content ) );
       		$excerpt = $post_content;
       	}
       	return $excerpt;
       }
       add_filter( 'the_excerpt', 'onepress_excerpt' );
       ```
   
 * Guido

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

The topic ‘Hook into Services section’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/onepress/2.3.17/screenshot.png)
 * OnePress
 * [Support Threads](https://wordpress.org/support/theme/onepress/)
 * [Active Topics](https://wordpress.org/support/theme/onepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/onepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/onepress/reviews/)

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [section](https://wordpress.org/support/topic-tag/section/)

 * 3 replies
 * 2 participants
 * Last reply from: [Guido](https://wordpress.org/support/users/guido07111975/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/hook-into-services-section/#post-9954640)
 * Status: resolved