Render page content outside of template
-
Hi there,
Im using ajax to call page content in some of my pages.function ajx_page_load() { //Check login cookie $hash = md5(get_site_url()); $loggedin = isset($_COOKIE['wordpress_logged_in_'.$hash]); $pageid = $_POST['pageid']; if($loggedin) { $content = get_post($pageid)->post_content; echo json_encode(array( 'content' => $content, 'user' => wp_get_current_user() )); }else { echo json_encode(array( 'content' => 'not logged in', 'user' => null, )); } die(); }
but $content spits out shortcode:
[vc_row][vc_column] My Page Content ? [/vc_column][/vc_row][vc_row][vc_column][vc_pie value=”69″ color=”sky” title=”nice chart” units=”%”][/vc_column][/vc_row]
How can I render this to html before returning it in my ajax response?
Many thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Render page content outside of template’ is closed to new replies.