• Resolved Guido

    (@guido07111975)


    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

    (@famethemes)

    Thread Starter Guido

    (@guido07111975)

    Hi,

    Thanks for your response.

    Not useful for me because the excerpt strips all HMTL markup as well.

    Guido

    Thread Starter Guido

    (@guido07111975)

    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.