Tags » Wordpress 2

WordPress search Post(news) with ajax

js code


/* All filter news and pagination*/
jQuery('.news-filter .categoryCheck').on( 'change' , function() {
if(!jQuery(this).val()){
jQuery('.news-filter .categoryCheck').prop( "checked", false );
}
load_news_list(0,1);
});

jQuery('.search-btn').on( 'click' , function() {
load_news_list(0,1);
});
jQuery('#srch_keyword').on('keypress', function(e){
if(e.keyCode == '13'){
e.preventDefault();
load_news_list(0,1);
}
});
jQuery('.pagination').on( 'click', '.page-numbers', function( event ) {
event.preventDefault();
page = find_page_number(jQuery(this));
var post_length = jQuery( '.news-div' ).length;
load_news_list( post_length, page);
});

 

/* load news list */
function load_news_list(post_length, page) {

var news_cats = jQuery('.categoryCheck:checked').map(function() {return this.value;}).get().join(',');
var year = ( jQuery( '#year' ).length > 0 ) ? 489 more words
WordPress

WordPress pagination with custom MySQL query

Simple pagination with custom query


$per_page = 50; # Set per page
$paged = ( get_query_var('paged') != 0 ) ? get_query_var('paged') : 1 ; ## get paged number
$offset = (( $paged - 1 ) * $per_page); ## set offset

$trial_list = football_trial_list(null, $offset, $per_page);

$trial_total = football_trial_list(null,0,-1);
$total = count($trial_total);

$max_num_pages = ceil( $total / $per_page );

$pagination = football_pagination($max_num_pages);

function football_trial_list($post_id = null, $offset = 0, $per_page = 3, $request = null){
global $wpdb;
$user_id = get_current_user_id();
$table_team = $wpdb->prefix . 447 more words
WordPress

Squarespace Ads

Annoy me. I love code. I got into working on web sites because of code. When HTML started to bore me, I was fortunate to need to learn JavaScript, Perl, CSS, PHP, XML, and another coding languages. 40 more words

Internet

WordPress wp_nav_menu() add new custom sub menu item

If some time we need to add new menu item in drop down list. bellow code to we can add sub menu.

See demo image… 132 more words

WordPress

Reflecting the Rising Sun

Life is a journey full of many beautiful scenes
I, the soul, come to …

~~~~~

Weekly Photo Challenge – Reflecting

to join in click here

Photography

Akismet WordPress Plugin 3.3.2 Now Available

Version 3.3.2 of the Akismet plugin for WordPress is now available. This update fixes a bug that was preventing some JavaScript from executing in wp-admin in some older browsers. 35 more words

Releases