Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Replace your above code with this following code :</p> <pre><code>&lt;?php /* Template Name: Meet The Team Template */ ?&gt; &lt;?php get_header(); ?&gt; &lt;div id="meet_posts" class="narrowcolumn"&gt; &lt;?php $recent = new WP_Query("cat=6&amp;orderby=title&amp;order=ASC"); while($recent-&gt;have_posts()):$recent-&gt;the_post(); $desc_values = get_post_custom_values("description"); ?&gt; &lt;div id="meetteam_featured_image" class="&lt;?php the_ID(); ?&gt;"&gt; &lt;a href="&lt;?php the_permalink() ?&gt;" rel="title"&gt; &lt;?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?&gt; &lt;/a&gt; &lt;/div&gt; &lt;?php endwhile ?&gt; &lt;div id="image-post-info"&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>Add this following code in functions.php file :</p> <pre><code>add_action( 'wp_ajax_ajaxified_function', 'ajaxified_function' ); add_action( 'wp_ajax_nopriv_ajaxified_function', 'ajaxified_function' ); function ajaxified_function() { $temp = get_post($_POST['post_id']); echo $temp-&gt;post_title.'&lt;br/&gt;&lt;br/&gt;'.$temp-&gt;post_content; die(); } </code></pre> <p>Add this following code in your custom js file :</p> <pre><code>jQuery(document).ready(function (){ jQuery('#meetteam_featured_image a').on('click',function(event){ event.preventDefault(); var post_id = jQuery(this).parent().attr('class'); jQuery.ajax({ type: "POST", url: 'http://www.yoursitename.com/wp-admin/admin-ajax.php', data: 'action=ajaxified_function&amp;post_id='+post_id, success: function (msg) { jQuery('#image-post-info').html(msg); }, error: function () { alert('Error'); } }); }); }); </code></pre> <p>Add custom js file by including following code in functions.php file :</p> <pre><code>function add_custom_scripts() { wp_enqueue_script( 'custom-scripts', get_stylesheet_directory_uri() .'/js/custom- scripts.js' ); } add_action( 'wp_enqueue_scripts', 'add_custom_scripts' ); </code></pre> <p>Hope this will help....!!!!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload