Blog

/Blog
Blog 2017-11-01T04:39:42+00:00

Reload Content in Masonry with jQuery append

jQuery('.leads').click(function(){ jQuery('.blogspace').html(''); var pagel = 1; var data = { action: 'my_getlatestleads', page: pagel, } jQuery.post(ajaxurl, data,function(response) { var mediaItemContainer = jQuery( '#blog-masonry' ); mediaItemContainer.masonry( { columnWidth: 200, itemSelector: '#post' } ); jQuery(mediaItemContainer ).prepend(response); jQuery( mediaItemContainer ).masonry( 'reloadItems' ); jQuery( mediaItemContainer ).masonry( 'layout' ); console.log('leads'); } );

By | July 11th, 2014|Categories: Wordpress 101 Guide|0 Comments

Load Post with jQuery and sort them with buttons

Code to insert on a page I want… eCom A Competitive Edge More Leads Code to Insert in your function files add_action( ‘wp_ajax_my_getlatest’, ‘get_latestresults’ ); add_action(‘wp_ajax_nopriv_my_getlatest’, ‘get_latestresults’); function get_latestresults($sresult) { global $wpdb; wp_reset_postdata(); $args = array( ‘posts_per_page’ => 10 ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); $format = get_post_format($post->ID); ?> < [...]

By | July 11th, 2014|Categories: Wordpress 101 Guide|0 Comments