Skip to content

Instantly share code, notes, and snippets.

@Bobz-zg
Bobz-zg / get-posts-2.js
Created August 25, 2016 10:06
Filter WordPress posts by custom taxonomy term with AJAX
function get_posts($params) {
$container = $('#container-async');
$content = $container.find('.content');
$status = $container.find('.status');
$status.text('Loading posts ...');
$.ajax({
url: bobz.ajax_url,
@Bobz-zg
Bobz-zg / filter-posts-mt.php
Last active February 26, 2022 00:41
Filter WordPress posts by multiple custom taxonomy terms with AJAX Raw
<?php
/**
* AJAC filter posts by taxonomy term
*/
function vb_filter_posts_mt() {
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) )
die('Permission denied');
/**
@Bobz-zg
Bobz-zg / filter-post-mt.js
Last active November 28, 2020 08:35
Filter WordPress posts by multiple taxonomy terms with AJAX and pagination
$('.sc-ajax-filter-multi').on('click', 'a[data-filter], .pagination a', function(event) {
if(event.preventDefault) { event.preventDefault(); }
$this = $(this);
/**
* Set filter active
*/
if ($this.data('filter')) {
$page = 1;
@hasanm95
hasanm95 / Visual comoposer with param_group
Created November 9, 2016 14:06
Create visual composer with param_group
//Backend visual composer add-on code
vc_map(array(
'name' => 'Accordions',
'base' => 'maxima_accordion',
'category' => 'Maxima',
'params' => array(
array(
'type' => 'textfield',
'name' => __('Title', 'rrf-maxima'),
@akyoscommunication
akyoscommunication / akyos-repeater.php
Last active June 15, 2021 09:34
[Repeater in vc_map] Mettre un repeater dans l'admin d'un shortcode #wordpress # Shortcode
vc_map(
array(
'name' => __('Timeline', 'text-domain'),
'base' => 'akyos_timeline',
'description' => __('Une timeline', 'text-domain'),
'category' => __('Akyos Elements', 'text-domain'),
'params' => array(
array(
'type' => 'param_group',
'value' => '',
@jayeshhpatel
jayeshhpatel / Create visual composer with param_group
Created August 12, 2021 03:59
Create visual composer with param_group
Visit : https://increativeweb.com/create-visual-composer-with-param_group
=============================
Sample 1
//Backend visual composer add-on code
vc_map(array(
'name' => 'Accordions',
'base' => 'maxima_accordion',
'category' => 'Maxima',
@jayeshhpatel
jayeshhpatel / DataTables Server Side Processing in WordPress (functions.php)
Last active December 23, 2023 06:05
DataTables Server Side Processing in WordPress
Add the following piece of code to your functions.php file.
add_shortcode('getMembership-lists', 'ajax_membership_table_shortcode');
// WITH AJAX LOAD TABLE
function membership_datatables_scripts() {
wp_register_style('datatables_style', '//cdn.datatables.net/1.11.1/css/jquery.dataTables.min.css');
wp_enqueue_style('datatables_style');