How to Get Back Format for The command “get_the_content” in wordpress
in wordpress are times when you need to use to command “get_the_content” to handle custom content or position … but when you show it to the outside site, all the attributes of html are gone, only the whole text without any html tags.
Currently in my web page using the code that I’m following your instructions, you first copy the code below and paste into the functions.php file
function get_the_content_with_formatting ($ more_link_text = '(more. ..)', $ stripteaser = 0, $ more_file ='')
{
$ content = get_the_content ($ more_link_text, $ stripteaser, $ more_file);
$ content = apply_filters ('the_content', $ content);
$ content = str_replace (']]>', ']]>', $ content);
return $ content;
}
then you just use this function, instead you use the function “get_the_content” thig you using function “get_the_content_with_formatting”, here is the code illustrated
$ abc = get_the_content_with_formatting ();
echo $ abc;
You do not? very easy right? you can do it all sounds very difficult but it is extremely simple.
wish you success.