Syntax for a function in order to get post’s title in JSON encoded response [closed]
You want to add the title to the response, not replace the response with the title. Like this: <?php function get_all_images($post_id=0, $size=”bigger”, $attributes=””) { $post_id = $_POST[‘post_id’]; if ($post_id<1) $postid = get_the_ID(); if ($images = get_children(array( ‘post_parent’ => $post_id, ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘post_mime_type’ => ‘image’,))) $title = get_the_title($post_id); $response=”<h2 … Read more