php - Wordpress using add action 'the content' deletes all pages content -


i using:

add_action('the_content' , 'statistics_page'); 

and in function 'statistics_page' put:

if(is_page(25)) { //blabla } 

this works on page want displayed on (25) other pages have content stripped, don't display anything.

how can fix this?

edit: info

website link: http://pauldekoning.com/wot
youll see home doesnt display text, nor forum page have forum.
statistic page displays something.

the_content filter should apply_filter instead of add_action , you've make sure return actual content function. try after updating code following.

apply_filters('the_content' , 'statistics_page');  function statistics_page($content){      if(  is_page(25) ) {          //blabla      }      return $content;  } 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

laravel - Undefined property: Illuminate\Pagination\LengthAwarePaginator::$id (View: F:\project\resources\views\admin\carousels\index.blade.php) -