Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] Possible to swap excerpt with post body using jQuery?

$
0
0

Hi rusty,

Yes, it is possible to do it with Views + Jquery
See the live demo:
http://luo195.discover-wp.com/2014/06/20/possible-to-swap-excerpt-with-post-body-using-jquery/
user/pass: xgren/111111

Content template:
http://luo195.discover-wp.com/wp-admin/post.php?post=13&action=edit&lang=en&message=4

<div class="post-excerpt">[wpv-post-excerpt more='<a href="#" class="more-button">more button</a>' length="20" count="word"]</div>
<div class="post-body" style="display:none;">[wpv-post-body view_template="None"]</div>

Js:

jQuery(document).ready(function($){
	$('a.more-button').on( "click", function( event ) {
  		$('div.post-excerpt').toggle();
  		$('div.post-body').toggle();
      	event.preventDefault();
	});
});

Viewing all articles
Browse latest Browse all 20145

Trending Articles