Changeset 3182625
- Timestamp:
- 11/05/2024 07:52:22 PM (17 months ago)
- Location:
- pt-filter/trunk
- Files:
-
- 5 added
- 5 edited
-
assets/css/pfilter-template.css (modified) (1 diff)
-
assets/js/pfilter-ajax-load.js (modified) (2 diffs)
-
functions/pfilter-functions.php (modified) (2 diffs)
-
ptfilter.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
shortcode-templates (added)
-
shortcode-templates/ajax-load-template.php (added)
-
shortcode-templates/ajax-loadmore-template.php (added)
-
shortcode-templates/isotop-load-template.php (added)
-
shortcode-templates/pagination-template.php (added)
Legend:
- Unmodified
- Added
- Removed
-
pt-filter/trunk/assets/css/pfilter-template.css
r3180324 r3182625 1 1 img{ 2 width: 350px;2 width: 100%; 3 3 height: 350px; 4 object-fit: cover; 4 5 } 5 6 .portfolio-item { 6 padding: 20px; 7 7 padding: 15px 0; 8 8 } 9 /* #ajax-filter-container.grid{ 10 height: 100vh !important; 11 } */ -
pt-filter/trunk/assets/js/pfilter-ajax-load.js
r3180324 r3182625 4 4 //// *=====* Ajax Filtering Code Here *======* //// 5 5 var container = $('#ajax-filter-container'); 6 var categoryContainer = $('#ajax-category-container');6 // var categoryContainer = $('#ajax-category-container'); 7 7 8 8 … … 26 26 nonce: pt_nonce2, 27 27 }; 28 28 29 $.ajax({ 29 30 type: 'POST', -
pt-filter/trunk/functions/pfilter-functions.php
r3180324 r3182625 45 45 46 46 $query = new WP_Query($args); 47 echo '<div class="container">';48 echo '<div class="row">';49 47 while ($query->have_posts()) : $query->the_post(); 50 48 ?> 51 <div class="col-lg-4 grid-item">49 <div class="col-lg-4 col-md-6 col-sm-6 col-12 grid-item"> 52 50 <div class="portfolio-item content-overlay"> 53 51 <?php if (has_post_thumbnail()) : ?> … … 65 63 wp_reset_postdata(); 66 64 die(); 67 echo "</div>";68 echo "</div>";69 65 } 70 66 add_action('wp_ajax_ajax_filter', 'ptfilter_ajax_filter_function'); -
pt-filter/trunk/ptfilter.php
r3180324 r3182625 2 2 /** 3 3 * Plugin Name: PT Filter 4 * Plugin URI: https://wordpress.org/plugins/ptfilter4 * Plugin URI: devhiv.com/ptfilter 5 5 * Description: This is custom post ajax filter 6 * Version: 1.0. 07 * Author: Abdul Aziz Sardar6 * Version: 1.0.1 7 * Author: aponwpdev 8 8 * Author URI: https://profiles.wordpress.org/aponwpdev/ 9 9 * Text Domain: pt-filter … … 11 11 * License URI:http://www.gnu.org/licenses/gpl-2.0.txt 12 12 * Requires at least: 6.2 13 * Tested up to: 6.6 13 * Tested up to: 6.6.2 14 14 * Requires PHP: 7.4 15 15 * Domain Path: /languages … … 23 23 define('PTFILTER_PLUGIN_TEMPLATES_DIR', plugin_dir_path(__FILE__) . 'templates/'); 24 24 define('PTFILTER_DIR_URL_PRO', plugin_dir_url(__FILE__)); 25 define('PTFILTER_VERSION', '1.0.0'); 26 25 define('PTFILTER_VERSION', '1.0.1'); 27 26 28 27 require PTFILTER_DIR_PATH_PRO . 'post-type/post-type.php'; … … 52 51 53 52 function ptfilter_load_text_domain() { 54 55 53 load_plugin_textdomain('pt-filter', false, plugin_basename(dirname(__FILE__)) . '/languages'); 56 57 54 } 58 55 … … 104 101 add_action('save_post', 'ptfilter_save_selected_template'); 105 102 103 // Function to load the AJAX Load Template 104 if ( ! function_exists( 'ptfilter_ajax_load_shortcode' ) ) { 105 function ptfilter_ajax_load_shortcode() { 106 ob_start(); 107 $template_path = plugin_dir_path( __FILE__ ) . 'shortcode-templates/ajax-load-template.php'; 108 // Check if the template file exists before including it 109 if ( file_exists( $template_path ) ) { 110 include $template_path; 111 } 112 return ob_get_clean(); 113 } 114 } 115 // Function to load the AJAX Load More button Template 116 if( ! function_exists( 'ptfilter_ajax_load_more_shortcode' )){ 117 function ptfilter_ajax_load_more_shortcode(){ 118 ob_start(); 119 $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/ajax-loadmore-template.php'; 120 // Check if the template file exists before including it 121 if ( file_exists( $template_path ) ) { 122 include $template_path; 123 } 124 return ob_get_clean(); 125 } 126 } 106 127 107 function ptfilter_apply_custom_page_template($template) 108 { 128 // Function to load the isotop filter template 129 if( ! function_exists( 'ptfilter_isotop_filter_shortcode' )){ 130 function ptfilter_isotop_filter_shortcode(){ 131 ob_start(); 132 $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/isotop-load-template.php'; 133 // Check if the template file exists before including it 134 if ( file_exists( $template_path ) ) { 135 include $template_path; 136 } 137 return ob_get_clean(); 138 } 139 } 109 140 110 $selected_template = get_post_meta(get_the_ID(), '_wp_page_template', true); 111 112 if ($selected_template === 'pfilter-template.php') { 113 // Load your custom template file when the "Pfilter Template" template is selected. 114 $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-template.php'; 115 } elseif ($selected_template === 'pfilter-ajax-load.php') { 116 $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-ajax-load.php'; 117 } elseif ($selected_template === 'pfilter-loadmore.php') { 118 $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-loadmore.php'; 119 } elseif($selected_template === 'pfilter-template-pagination.php') { 120 $template = PTFILTER_PLUGIN_TEMPLATES_DIR . 'pfilter-template-pagination.php'; 141 // Function to pagination template 142 if( ! function_exists( 'ptfilter_pagination_shortcode' )){ 143 function ptfilter_pagination_shortcode(){ 144 ob_start(); 145 $template_path = plugin_dir_path(__FILE__) . 'shortcode-templates/pagination-template.php'; 146 // Check if the template file exists before including it 147 if ( file_exists( $template_path ) ) { 148 include $template_path; 149 } 150 return ob_get_clean(); 121 151 } 152 } 122 153 123 154 124 return $template; 155 // Register the shortcode 156 function ptfilter_register_shortcodes() { 157 add_shortcode('ptfilter_pagination', 'ptfilter_pagination_shortcode'); 158 add_shortcode('ptfilter_ajax_load_more_button', 'ptfilter_ajax_load_more_shortcode'); 159 add_shortcode('ptfilter_load_iso_filter', 'ptfilter_isotop_filter_shortcode'); 160 add_shortcode('ptfilter_ajax_load', 'ptfilter_ajax_load_shortcode'); 125 161 } 126 add_ filter('template_include', 'ptfilter_apply_custom_page_template');162 add_action('init', 'ptfilter_register_shortcodes'); -
pt-filter/trunk/readme.txt
r3180324 r3182625 7 7 Contributors: aponwpdev 8 8 Requires at least: 6.1 9 Tested up to: 6.6 10 Stable tag: 1.0. 09 Tested up to: 6.6.2 10 Stable tag: 1.0.1 11 11 Requires PHP: 7.3 12 Version: 1.0. 012 Version: 1.0.1 13 13 14 14 15 PT Filter is a custom post ajax page template.15 PT Filter is a custom posts filtering ajax ,isotop, loadmore button, and paginations 16 16 17 17 == Description == … … 38 38 3. Then create posts and create category 39 39 4. The categories that are created should be sorted by posts 40 5. Select any theme and create a page and select template, like there are 4 template 'Filter Template','Pagination Template','Ajax Load','Load More' then select anyone and view the page. 'NOTE:' if its FSE theme or 2024/23 wordpress default FSE theme Then create only page and come to pages dashboard then click quick edit and then select any one of the 4 templates . 40 5. Select any theme and create a page and use the shortcode anywhere u want like ELementor/Gutenberg/wordpress default posts/pages/ wp bakery/oxyzen/divi. 41 6.Here the 4 shortcode [ptfilter_ajax_load],[ptfilter_load_iso_filter], 42 [ptfilter_ajax_load_more_button], 43 [ptfilter_pagination] 44 45 ## Screenshots ## 46 47 1. After active plugin known file 48 2. Create Custom Posts 49 3. Create posts wise category 50 4. Use 4 short code in page or any where 51 5. Ajax Load view 52 6. Load aso posts view 53 7. Ajax button posts view 54 8. Pagination view 55 56 ## Changelog ## 57 58 = 1.0.1 06-11-2024 = 59 60 * Compatible with your version of WordPress 61 * Bug Fixes 62 * Update code 63 * Updated documantation 64 * remove complex user compablity
Note: See TracChangeset
for help on using the changeset viewer.