I’m using the function:
<?php the_title(); ?>
To get the post title. I want to get the post text/the body which is the second field of the post but I don’t know how. I tried two functions:
<?php the_content(); ?> and <?php the_excerpt(); ?>
They work but I get other things from wordpress plugins that are part of my post (like share buttons). I cannot disable these plugins. Is there any way to get what is in the second field without anything else?
I think your problem is that
the_content()
runs all the filters attached tothe_content
. Try callingget_the_content()
, and echo its return:If you want the filters applied, you can call:
You might have a social media plugin installed that automatically adds facebook buttons etc. Have a peek inside your admin panel > plugins for any such plugin
A down-and-dirty way to hide the share plugin on certain posts could be using some simple jQuery like this:
Not ideal, but other than modifying the plugin directly, you may not have a choice. You could repeat the above line for every post where you want to hide the sharing plugin.