{
    "2_shortcodes_configuration": {
        "title": "<h4>Configuration &amp; Using Shortcodes</h4>",
        "content": "<p>The <strong>Quick Ajax Post Loader</strong> plugin allows dynamic post loading using shortcodes. Shortcodes provide a flexible way to display posts with AJAX-based filtering, sorting, and pagination.</p>\n<p>In this section, you will learn how to:</p>\n<ul>\n<li><strong>Create and configure a shortcode</strong> using the WordPress admin panel.</li>\n<li><strong>Customize sorting, filtering, and layout settings</strong> to match your needs.</li>\n<li><strong>Use the shortcode</strong> inside pages and posts to dynamically load content.</li>\n<li><strong>Test and troubleshoot</strong> shortcode behavior.</li>\n</ul>\n<p>Each subsection provides detailed information on how to fine-tune these settings.</p>\n<h4>Creating a Shortcode</h4>\n<p>To add a new shortcode:</p>\n<ul class=\"ul-numbered\">\n<li>Go to <strong>Quick Ajax &gt; Shortcodes</strong> in the WordPress admin panel.</li>\n<li>Click <strong>Add New Shortcode</strong> and fill in the configuration form.</li>\n<li>Enter the following details:<ul>\n<li><strong>Shortcode Name</strong> - Provide a name for the configuration, e.g., &quot;My Post List.&quot;</li>\n<li><strong>Select Post Type</strong> - Choose the type of content to load (e.g., posts, pages, or custom post types).</li>\n<li><strong>Show Taxonomy Filter</strong> - Enable or disable filtering by category or tag.</li>\n<li><strong>Select Taxonomy</strong> - If filtering is enabled, select which taxonomy (e.g., categories, tags) will be used.</li>\n<li><strong>Select Specific Terms</strong> - If enabled, you can manually choose specific terms to include in the filter.</li>\n<li><strong>Choose Terms</strong> - Select one or more terms from the selected taxonomy to be available in the filter. If no terms are selected, no results will be shown.</li>\n<li><strong>Posts Per Page</strong> - Define how many posts will be loaded in a single AJAX request.</li>\n</ul>\n</li>\n</ul>\n<p>After saving the settings, copy the generated shortcode, e.g.:</p>\n<pre><code class=\"no-background\">[qapl-quick-ajax id=&quot;125&quot; title=&quot;My Post List&quot;]\n</code></pre>\n<p>Paste it anywhere on a page or post to display dynamically loaded posts.</p>\n<h4>Sorting Settings</h4>\n<p>This section allows you to configure how posts are sorted when loaded via AJAX.</p>\n<ul>\n<li><strong>Default Sort Order</strong> - Choose whether posts should be displayed in ascending or descending order.</li>\n<li><strong>Default Sort By</strong> - Select the sorting criteria (e.g., by title, date, or comment count).</li>\n<li><strong>Show Sorting Button</strong> - Allows users to switch between ascending and descending sorting.</li>\n<li><strong>Available Sorting Options</strong> - Choose which sorting methods will be available (e.g., newest, oldest, most popular).</li>\n<li><strong>Inline Filter &amp; Sorting</strong> - Display sorting and filtering controls in a single row.</li>\n</ul>\n<h4>Additional Settings</h4>\n<p>This section allows you to configure extra AJAX query parameters:</p>\n<ul>\n<li><strong>Excluded Post IDs</strong> - Specify post IDs that should be excluded from the results.</li>\n<li><strong>Ignore Sticky Posts</strong> - Treat sticky posts as regular entries.</li>\n<li><strong>Load Initial Posts via AJAX</strong> - If disabled, the first batch of posts will be pre-rendered in HTML instead of loaded dynamically.</li>\n<li><strong>Enable Infinite Scroll</strong> - Enable this option to automatically load more posts via AJAX as the user scrolls down the page.</li>\n</ul>\n<h4>Layout Settings</h4>\n<p>Customize how posts are displayed:</p>\n<ul>\n<li><strong>Apply Quick AJAX CSS Style</strong> - Use built-in Quick AJAX styles for consistent layout and spacing.</li>\n<li><strong>Number of Columns</strong> - Define the number of columns in the post grid.</li>\n<li><strong>Select Post Item Template</strong> - Choose between the default or a custom post template.</li>\n<li><strong>Add class to taxonomy filter</strong> - Add custom CSS classes to the taxonomy filter section.</li>\n<li><strong>Add class to post container</strong> - Add custom CSS classes to the post container for styling flexibility.</li>\n<li><strong>Custom Load More Post Quantity</strong> - Set how many posts load each time the <strong>&quot;Load More&quot;</strong> button is clicked.</li>\n<li><strong>Override Global Loader Icon</strong> - Customize the loading animation icon displayed during AJAX requests.</li>\n</ul>\n<h4>Using the Shortcode on a Page</h4>\n<p>To insert the shortcode into a post or page:</p>\n<ul class=\"ul-numbered\">\n<li>Open a page or post in the WordPress editor.</li>\n<li>Paste the generated shortcode into the content (use the <strong>Shortcode</strong> block in Gutenberg or the Classic Editor).</li>\n<li>Save changes and preview the page.</li>\n</ul>\n<h4>Testing and Verification</h4>\n<p>After adding the shortcode, verify its behavior:</p>\n<ul>\n<li><strong>Dynamic Loading</strong> - Posts should appear without requiring a full-page reload.</li>\n<li><strong>Filtering</strong> - If filters are enabled, test their functionality.</li>\n<li><strong>Sorting</strong> - Confirm that sorting options modify the post order as expected.</li>\n<li><strong>&quot;Load More&quot; Button</strong> - Check that additional posts load correctly.</li>\n<li><strong>Post Grid Layout</strong> - Ensure that the layout adapts properly to different screen sizes.</li>\n</ul>\n<p>If you encounter issues, return to <strong>Quick Ajax &gt; Shortcodes</strong> settings and adjust the configuration.</p>\n<h4>Shortcode Best Practices</h4>\n<ul>\n<li><strong>Test shortcodes on a staging site</strong> before deploying them to a live website.</li>\n<li><strong>Ensure theme compatibility</strong> - Some themes may override styling, affecting the layout.</li>\n<li><strong>Refer to the documentation</strong> - Learn more about <strong>custom templates, hooks, and the AJAX Function Generator</strong> for advanced customization.</li>\n</ul>"
    },
    "3_creating_custom_templates": {
        "title": "<h4>Templates: How to Create Custom Post Layouts</h4>",
        "content": "<p>You can create custom post templates to adjust the layout and structure of dynamically loaded posts.</p>\n<h4>Template File Location</h4>\n<p>To add a custom template, place a PHP file in your theme directory (preferably in a child theme) at the following path:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/post-items/\n</code></pre>\n<h4>Creating a New Template File</h4>\n<ul class=\"ul-numbered\">\n<li><p>Create a new PHP file with a name starting with <strong>&quot;post-item&quot;</strong>, e.g.:</p>\n<p> post-item-custom-name.php</p>\n</li>\n<li><p>Add a header with the template name:</p>\n <?php\n /* Post Item Name: My Custom Template */\n ?>\n</li>\n<li><p>Define the HTML structure and PHP logic for rendering a single post.</p>\n</li>\n</ul>\n<p>Example template code:</p>\n<pre><code class=\"no-background\">&lt;?php\n/* Post Item Name: My Custom Template */\n?&gt;\n&lt;div class=&quot;qapl-post-item&quot;&gt;\n   &lt;a href=&quot;&lt;?php echo get_permalink(); ?&gt;&quot;&gt;\n      &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;\n      &lt;p&gt;&lt;?php the_excerpt(); ?&gt;&lt;/p&gt;\n   &lt;/a&gt;\n&lt;/div&gt;\n</code></pre>\n<h4>Testing the Template</h4>\n<ul class=\"ul-numbered\">\n<li>Save the file and go to the shortcode settings.</li>\n<li>Select the new template from the available options.</li>\n<li>Test whether the posts are rendered correctly using the new template.</li>\n</ul>"
    },
    "3_overriding_templates": {
        "title": "<h4>Templates: How to Override Default Post Layouts</h4>",
        "content": "<p>The plugin allows you to <strong>override default post templates</strong> without modifying the plugin files.</p>\n<h4>Default Template Location</h4>\n<p>The default post templates are located in the plugin folder. To override them, copy the relevant file to your theme&#39;s template directory and make modifications:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/post-items/\n</code></pre>\n<h4>Example of Overriding a Default Template</h4>\n<ul class=\"ul-numbered\">\n<li>Copy the <strong>post-item.php</strong> file from the plugin folder to your theme&#39;s template directory.</li>\n<li>Modify its HTML structure, add custom CSS classes, or change the way content is displayed.</li>\n</ul>\n<p>WordPress follows this template loading priority:</p>\n<ul class=\"ul-numbered\">\n<li>It first loads templates from the <strong>child theme</strong>.</li>\n<li>Then, it loads templates from the <strong>parent theme</strong>.</li>\n<li>If no matching file is found, the plugin uses the <strong>default templates</strong>.</li>\n</ul>"
    },
    "3_custom_no_posts_template": {
        "title": "<h4>Templates: Customize &quot;No Posts Found&quot; Message</h4>",
        "content": "<p>By default, if no posts match the AJAX query, the plugin displays a <strong>&quot;No Posts Found&quot;</strong> message. You can customize this message by creating a custom template file.</p>\n<h4>Template File Location</h4>\n<p>Place a file named <strong>no-posts.php</strong> in the following directory:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/post-items/\n</code></pre>\n<h4>Example File Structure</h4>\n<pre><code class=\"no-background\">&lt;div class=&quot;qapl-no-posts-found&quot;&gt;\n   &lt;p&gt;Sorry, no posts found to display.&lt;/p&gt;\n&lt;/div&gt;\n</code></pre>"
    },
    "3_custom_end_of_posts_template": {
        "title": "<h4>Templates: Customize &quot;End of Posts&quot; Message</h4>",
        "content": "<p>When all posts have been loaded via AJAX and there are no more available to show, the plugin can display a customizable end message.</p>\n<h4>Template File Location</h4>\n<p>Place a file named <strong>end-posts.php</strong> in the following directory:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/post-items/\n</code></pre>\n<h4>Example File Structure</h4>\n<pre><code class=\"no-background\">&lt;div class=&quot;qapl-end-message&quot;&gt;\n    &lt;p&gt;No more posts to load.&lt;/p&gt;\n&lt;/div&gt;\n</code></pre>"
    },
    "3_custom_taxonomy_buttons": {
        "title": "<h4>Templates: Modify Taxonomy Filter Buttons</h4>",
        "content": "<p>Taxonomy filter buttons allow users to select categories, tags, or other taxonomies.</p>\n<h4>Template File Location</h4>\n<p>Place the filter button template file in the following directory:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/taxonomy-filter/\n</code></pre>\n<h4>Creating or Overriding the File</h4>\n<p>Create or edit the <strong>taxonomy-filter-button.php</strong> file.</p>\n<h4>Example File Structure</h4>\n<pre><code class=\"no-background\">&lt;button type=&quot;button&quot; class=&quot;qapl-filter-button custom-class&quot; data-button=&quot;quick-ajax-filter-button&quot;&gt;\n   QUICK_AJAX_LABEL\n&lt;/button&gt;\n</code></pre>\n<h4>Note:</h4>\n<ul>\n<li>The <strong>label (<code class=\"code-tag\">QUICK_AJAX_LABEL</code>) and <code class=\"code-tag\">data-button</code> attribute are required</strong> for filtering to work correctly.</li>\n<li>You can add <strong>custom CSS styles</strong> to make the buttons match your site&#39;s design.</li>\n</ul>"
    },
    "3_custom_load_more_button": {
        "title": "<h4>Templates: Customize &quot;Load More&quot; Button Design</h4>",
        "content": "<p>The &quot;Load More&quot; button allows users to dynamically load additional posts via AJAX without refreshing the page.<br>The plugin provides a default button template, but you can override it with your custom design.</p>\n<h4>Template File Location</h4>\n<p>The default &quot;Load More&quot; button template is located in the plugin directory:</p>\n<pre><code class=\"no-background\">quick-ajax-post-loader/templates/loader-more-button.php\n</code></pre>\n<p>To override it, copy it to your theme folder:</p>\n<pre><code class=\"no-background\">wp-content/themes/your-theme/quick-ajax-post-loader/templates/\n</code></pre>\n<h4>Example File Structure</h4>\n<pre><code class=\"no-background\"> &lt;button type=&quot;button&quot; class=&quot;qapl-load-more-button custom-class&quot; data-button=&quot;quick-ajax-load-more-button&quot;&gt;\n    Load More\n &lt;/button&gt;\n</code></pre>\n<h4>Modifying the Template</h4>\n<ul>\n<li>Adjust the <strong>HTML structure</strong>, CSS classes, or button text to match your website&#39;s design.</li>\n</ul>"
    },
    "3_creating_custom_loader": {
        "title": "<h4>Templates: How to Create Custom Loading Icons</h4>",
        "content": "<p>The <strong>Quick Ajax Post Loader</strong> plugin allows you to customize loading icons by creating your own templates. You can use HTML, CSS animations, or GIFs, and then select the icon in the plugin configuration.</p>\n<h4>Steps to Create a Custom Loading Icon</h4>\n<ul class=\"ul-numbered\">\n<li><p>Navigate to the directory:</p>\n<p> wp-content/themes/your-active-theme/quick-ajax-post-loader/templates/loader-icon/</p>\n</li>\n<li><p>Create a file with a descriptive name, e.g., <strong>loader-icon-custom-loader.php</strong>.</p>\n</li>\n<li><p>Add your custom HTML, CSS, or JavaScript code for the loading icon.</p>\n</li>\n</ul>\n<h4>Example Loading Icon Cod</h4>\n<pre><code class=\"no-background\">&lt;?php\n/* Loader Icon Name: Custom Loader */\n?&gt;\n&lt;div class=&quot;qapl-loader-custom&quot;&gt;\n    &lt;!-- Add your custom HTML, CSS, or animations --&gt;\n    &lt;img src=&quot;images/loader_image.gif&quot; alt=&quot;Loading...&quot; /&gt;\n    &lt;!-- Example CSS animation --&gt;\n    &lt;div class=&quot;loader-dot&quot;&gt;&lt;/div&gt;\n    &lt;div class=&quot;loader-dot&quot;&gt;&lt;/div&gt;\n    &lt;div class=&quot;loader-dot&quot;&gt;&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<h4>Rules for Overriding and Loading Icons</h4>\n<ul class=\"ul-numbered\">\n<li><p><strong>Directory Placement</strong>: Place the custom loading icon file in the child theme or theme directory:</p>\n<p> wp-content/themes/your-active-theme/quick-ajax-post-loader/templates/loader-icon/</p>\n</li>\n<li><p><strong>Template Detection</strong>: The plugin automatically detects all files in this directory as available loading icons.</p>\n</li>\n<li><p><strong>Loading Order</strong>:</p>\n<ul>\n<li><strong>First</strong>, the plugin checks the child theme directory.</li>\n<li><strong>Next</strong>, it checks the parent theme directory.</li>\n<li><strong>If no file is found</strong>, it uses the default icons from the plugin.</li>\n</ul>\n</li>\n</ul>\n<p>This ensures that custom loading icons in the child theme take priority and are not overwritten during theme or plugin updates.</p>"
    },
    "3_best_practices": {
        "title": "<h4>Templates: Best Practices for Working with Post Layouts</h4>",
        "content": "<ul>\n<li><strong>Work with a child theme</strong> - This ensures that your changes won&#39;t be lost when updating your theme or the plugin.</li>\n<li><strong>Test all changes on a staging site</strong> before deploying them to your live site.</li>\n<li><strong>Use clear comments in your modifications</strong> to make future maintenance easier.</li>\n<li><strong>Utilize dedicated hooks and filters</strong> to introduce changes <strong>without modifying core plugin template files</strong>.</li>\n</ul>"
    },
    "4_filter_container_hooks": {
        "title": "<h4>Hooks: Filter Container - Modify the Filtering Section</h4>",
        "content": "<p>Filter container hooks allow you to insert custom elements within the filter section of the plugin interface. These hooks provide flexibility to enhance filtering options or add additional UI components.</p>\n<p>Below is a list of available hooks and their usage.</p>\n<h4><strong>qapl_filter_container_before</strong></h4>\n<p>Triggered just before rendering the filter container.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - the unique identifier of the plugin instance.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_filter_container_before( $quick_ajax_id ) {\n    if ( $quick_ajax_id === &#39;p963&#39; ) {\n        echo &#39;&lt;div class=&quot;custom-filter-header&quot;&gt;My Custom Filter Section&lt;/div&gt;&#39;;\n    }\n}\nadd_action( &#39;qapl_filter_container_before&#39;, &#39;my_filter_container_before&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_filter_container_start</strong></h4>\n<p>Triggered at the beginning of the filter container rendering.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_filter_container_start( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-filter-start&quot;&gt;Start of the filter container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_filter_container_start&#39;, &#39;my_filter_container_start&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_filter_container_end</strong></h4>\n<p>Triggered just before finishing the rendering of the filter container.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_filter_container_end( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-filter-end&quot;&gt;End of the filter container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_filter_container_end&#39;, &#39;my_filter_container_end&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_filter_container_after</strong></h4>\n<p>Triggered immediately after rendering the filter container.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_filter_container_after( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-filter-after&quot;&gt;After the filter container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_filter_container_after&#39;, &#39;my_filter_container_after&#39;, 10, 1 );\n</code></pre>"
    },
    "4_post_container_hooks": {
        "title": "<h4>Hooks: Post Container - Modify Post List Display</h4>",
        "content": "<p>Post container hooks allow you to modify the area where dynamically loaded posts are displayed. These hooks can be used to add custom elements before or after the post list, style the container, or display additional information.</p>\n<p>Here are the available post container hooks.</p>\n<h4><strong>qapl_posts_container_before</strong></h4>\n<p>Triggered before rendering the post container.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_posts_container_before( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-posts-before&quot;&gt;Before the post container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_posts_container_before&#39;, &#39;my_posts_container_before&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_posts_container_start</strong></h4>\n<p>Triggered at the beginning of the post container rendering.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_posts_container_start( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-posts-start&quot;&gt;Start of the post container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_posts_container_start&#39;, &#39;my_posts_container_start&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_posts_container_end</strong></h4>\n<p>Triggered just before finishing the rendering of the post container.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_posts_container_end( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-posts-end&quot;&gt;End of the post container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_posts_container_end&#39;, &#39;my_posts_container_end&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_posts_container_after</strong></h4>\n<p>Triggered immediately after rendering the post container.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_posts_container_after( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-posts-after&quot;&gt;After the post container&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_posts_container_after&#39;, &#39;my_posts_container_after&#39;, 10, 1 );\n</code></pre>"
    },
    "4_load_more_hooks": {
        "title": "<h4>Hooks: Load More Button - Customize Load More Behavior</h4>",
        "content": "<p>Load More button hooks allow you to modify the behavior and appearance of the <strong>&quot;Load More&quot;</strong> button and its surrounding elements. These hooks give you control over what happens before and after the loading process, enabling you to add custom animations, messages, or additional elements.</p>\n<p>Here are the available hooks for customizing the loading experience:</p>\n<h4><strong>qapl_loader_before</strong></h4>\n<p>Triggered before rendering the loading element (e.g., &quot;Load More&quot; button or loading animation).</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_loader_before( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-loader-before&quot;&gt;Loading starts...&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_loader_before&#39;, &#39;my_loader_before&#39;, 10, 1 );\n</code></pre>\n<h4><strong>qapl_loader_after</strong></h4>\n<p>Triggered after rendering the loading element.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function my_loader_after( $quick_ajax_id ) {\n    echo &#39;&lt;div class=&quot;custom-loader-after&quot;&gt;Loading finished&lt;/div&gt;&#39;;\n}\nadd_action( &#39;qapl_loader_after&#39;, &#39;my_loader_after&#39;, 10, 1 );\n</code></pre>"
    },
    "4_modify_posts_query": {
        "title": "<h4>Hooks: Modify WP_Query Parameters for AJAX Requests</h4>",
        "content": "<p>Query modification hooks allow you to <strong>customize the post retrieval process</strong> by altering WP_Query arguments before the AJAX request is executed. This enables fine-grained control over which posts are displayed.</p>\n<h4><strong>qapl_modify_posts_query_args</strong></h4>\n<p>This filter allows you to modify <strong>WP_Query</strong> arguments to fully control the data retrieved by AJAX requests.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$args</code> <em>(array)</em> - original query arguments.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function modify_query_args( $args, $quick_ajax_id ) {\n    if ($quick_ajax_id === &#39;p963&#39;) {\n        $args[&#39;posts_per_page&#39;] = 5; // change posts per page to 5\n    }\n    return $args;\n}\nadd_filter( &#39;qapl_modify_posts_query_args&#39;, &#39;modify_query_args&#39;, 10, 2 );\n</code></pre>\n<p>This example shows how to change the number of posts per page to <strong>5</strong>, using a specific AJAX identifier.</p>"
    },
    "4_modify_sorting_options": {
        "title": "<h4>Hooks: Modify Sorting Options for AJAX Queries</h4>",
        "content": "<p>Sorting filters allow you to <strong>customize or extend the available sorting methods</strong> used by the AJAX query. This can be useful for adding new sorting options based on custom fields, modified dates, or taxonomies.</p>\n<h4><strong>qapl_modify_sorting_options_variants</strong></h4>\n<p>This filter allows modifying or extending the available sorting methods.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$sorting_options</code> <em>(array)</em> - array containing sorting options.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function modify_sorting_options_variants( $sorting_options, $quick_ajax_id ) {\nif ($quick_ajax_id === &#39;p963&#39;) {\n    $sorting_options[] = [\n        &#39;orderby&#39; =&gt; &#39;modified&#39;,\n        &#39;order&#39;   =&gt; &#39;DESC&#39;,\n        &#39;label&#39;   =&gt; &#39;Modify date&#39;,\n    ];\n}\nreturn $sorting_options;\n</code></pre>\n<p>}\nadd_filter( &#39;qapl_modify_sorting_options_variants&#39;, &#39;modify_sorting_options_variants&#39;, 10, 2 );</p>\n<p>This example adds a <strong>sorting option based on the last modified date</strong> for the AJAX instance with <strong>quick_ajax_id = &#39;p369&#39;</strong>.</p>"
    },
    "4_modify_taxonomy_filters": {
        "title": "<h4>Hooks: Modify Taxonomy Filter Buttons</h4>",
        "content": "<p>Taxonomy filter hooks let you <strong>modify the taxonomy filter buttons</strong>, changing their appearance, labels, or even adding custom logic.</p>\n<h4><strong>qapl_modify_taxonomy_filter_buttons</strong></h4>\n<p>This filter allows modifying the properties of taxonomy filter buttons.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$buttons</code> <em>(array)</em> - array containing button data.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function modify_filter_buttons( $buttons, $quick_ajax_id ) {\n    foreach ($buttons as &amp;$button) {\n        if ($quick_ajax_id === &#39;p963&#39;) {\n            if ($button[&#39;term_id&#39;] === &#39;none&#39;) {\n                $button[&#39;button_label&#39;] = &#39;View All&#39;;\n            } else {\n                $button[&#39;button_label&#39;] = strtoupper($button[&#39;button_label&#39;]);\n            }\n        }\n    }\n    return $buttons;\n}\nadd_filter( &#39;qapl_modify_taxonomy_filter_buttons&#39;, &#39;modify_filter_buttons&#39;, 10, 2 );\n</code></pre>\n<p>This example changes the <strong>&quot;Show All&quot;</strong> button label to <strong>&quot;View All&quot;</strong> and converts the labels of other filter buttons to uppercase.</p>"
    },
    "4_modify_post_content": {
        "title": "<h4>Hooks: Modifying Post Content Elements</h4>",
        "content": "<p>These filters allow customizing different parts of the post content.</p>\n<h4>Modifying the Post Title</h4>\n<h4><strong>qapl_template_post_item_title</strong></h4>\n<p>Modify the <strong>title HTML output</strong>.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the post title.</li>\n<li><code class=\"code-tag\">$template</code> <em>(string)</em> - the template file name.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_post_title( $output, $template, $quick_ajax_id ) {\n    if ( $template === &#39;post-item&#39; ) {\n        $output = &#39;&lt;div class=&quot;qapl-post-title&quot;&gt;&lt;h2 class=&quot;custom-title&quot;&gt;&#39; . esc_html(get_the_title()) . &#39;&lt;/h2&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_post_item_title&#39;, &#39;customize_post_title&#39;, 10, 3 );\n</code></pre>\n<p>This example wraps the title in an <strong>H2 tag</strong> and adds a permalink.</p>\n<h4>Modifying the Post Excerpt</h4>\n<h4><strong>qapl_template_post_item_excerpt</strong></h4>\n<p>Modify the <strong>excerpt HTML output</strong>.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the post excerpt.</li>\n<li><code class=\"code-tag\">$template</code> <em>(string)</em> - the template file name.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_post_excerpt( $output, $template, $quick_ajax_id ) {\n    if ( $template === &#39;post-item&#39; ) {\n        $output = &#39;&lt;div class=&quot;qapl-post-description&quot;&gt;&lt;p class=&quot;custom-excerpt&quot;&gt;&#39; . wp_trim_words(get_the_excerpt(), 15) . &#39;&lt;/p&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_post_item_excerpt&#39;, &#39;customize_post_excerpt&#39;, 10, 3 );\n</code></pre>\n<p>This example limits the excerpt to <strong>15 words</strong> and wraps it in a <code class=\"code-tag\">&lt;p&gt;</code> tag.</p>\n<h4>Modifying the Post Image</h4>\n<h4><strong>qapl_template_post_item_image</strong></h4>\n<p>Modify the <strong>featured image (thumbnail)</strong>.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the post thumbnail.</li>\n<li><code class=\"code-tag\">$template</code> <em>(string)</em> - the template file name (e.g., <code class=\"code-tag\">&#39;post-item.php&#39;</code>).</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_post_image( $output, $template, $quick_ajax_id ) {\n    if ( $template === &#39;post-item&#39; ) {\n        $output = &#39;&lt;div class=&quot;qapl-post-image&quot;&gt;&lt;img src=&quot;&#39; . esc_url(get_the_post_thumbnail_url(null, &quot;large&quot;)) . &#39;&quot; alt=&quot;&#39; . esc_attr(get_the_title()) . &#39;&quot;&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_post_item_image&#39;, &#39;customize_post_image&#39;, 10, 3 );\n</code></pre>\n<p>This example forces <strong>large images</strong> instead of using the default thumbnail size.</p>\n<h4>Modifying the Post Date</h4>\n<h4><strong>qapl_template_post_item_date</strong></h4>\n<p>Modify how the <strong>post date</strong> is displayed.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the post date.</li>\n<li><code class=\"code-tag\">$template</code> <em>(string)</em> - the template file name (e.g., <code class=\"code-tag\">&#39;post-item.php&#39;</code>).</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_post_date( $output, $template, $quick_ajax_id ) {\n    if ( $template === &#39;post-item&#39; ) {\n        $new_date = get_the_date( &#39;d-m-Y&#39; );\n        $output = &#39;&lt;div class=&quot;qapl-post-date&quot;&gt;&lt;div class=&quot;custom-date&quot;&gt;Date: &#39; . esc_html( $new_date ) . &#39;&lt;/div&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_post_item_date&#39;, &#39;customize_post_date&#39;, 10, 3 );\n</code></pre>\n<p>This example changes the <strong>date format</strong> and wraps it in a <code class=\"code-tag\">&lt;div class=&quot;custom-date&quot;&gt;&lt;/div&gt;</code> container.</p>\n<h4>Modifying the Read More Label</h4>\n<h4><strong>qapl_template_post_item_read_more</strong></h4>\n<p>Modify the <strong>&quot;Read More&quot; label inside post content</strong>.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the &quot;Read More&quot; Label.</li>\n<li><code class=\"code-tag\">$template</code> <em>(string)</em> - the template file name.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_read_more( $output, $template, $quick_ajax_id ) {\n    if ( $template === &#39;post-item&#39; ) {\n        $output = &#39;&lt;div class=&quot;qapl-read-more custom-read_more&quot;&gt;&lt;p&gt;Read Full Article&lt;/p&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_post_item_read_more&#39;, &#39;customize_read_more&#39;, 10, 3 );\n</code></pre>\n<p>This example changes the <strong>text of the &quot;Read More&quot; button</strong> to &quot;Read Full Article&quot;.</p>"
    },
    "4_modify_no_post_message": {
        "title": "<h4>Hooks: Customize &quot;No Posts Found&quot; Message</h4>",
        "content": "<p>Customize the <strong>&quot;No Posts Found&quot; message</strong> displayed when there are no posts to show initially (e.g., after filtering).</p>\n<h4><strong>qapl_template_no_post_message</strong></h4>\n<p>Modify the HTML output for the message shown when no posts match the filter or query.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the default message HTML output.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_no_post_message( $output, $quick_ajax_id ) {\n    if ( $quick_ajax_id === &#39;p963&#39; ) {\n        $output = &#39;&lt;div class=&quot;custom-no-posts-found&quot;&gt;&lt;p&gt;Nothing to display&lt;/p&gt;&lt;/div&gt;&#39;;\n    }\n    return $output;\n}\nadd_filter( &#39;qapl_template_no_post_message&#39;, &#39;customize_no_post_message&#39;, 10, 2 );\n</code></pre>\n<p>This example replaces the <strong>default &quot;No Posts Found&quot; message</strong> with a custom message for a specific instance.</p>"
    },
    "4_modify_end_post_message": {
        "title": "<h4>Hooks: Customize End of Posts Message</h4>",
        "content": "<p>Customize the <strong>&quot;End of Posts&quot; message</strong> displayed when all posts have been loaded and there are no more items to show.</p>\n<h4><strong>qapl_template_end_post_message</strong></h4>\n<p>Modify the HTML output for the final message shown when no more posts are available to load.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the default message HTML output.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_end_post_message( $output, $quick_ajax_id ) {\n    $output = &#39;&lt;div class=&quot;custom-end-message&quot;&gt;&lt;p&gt;That\\&#39;s all we have for now!&lt;/p&gt;&lt;/div&gt;&#39;;\n    return $output;\n}\nadd_filter( &#39;qapl_template_end_post_message&#39;, &#39;customize_end_post_message&#39;, 10, 2 );\n</code></pre>\n<p>This example replaces the <strong>default &quot;End of Posts&quot; message</strong> with a custom-styled HTML block.</p>"
    },
    "4_modify_loadmore_button": {
        "title": "<h4>Hooks: Customize Load More Button HTML &amp; Styling</h4>",
        "content": "<p>Customize the <strong>&quot;Load More&quot; button</strong> styling and behavior.</p>\n<h4><strong>qapl_template_load_more_button</strong></h4>\n<p>Modify the <strong>&quot;Load More&quot; button</strong> HTML output.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code class=\"code-tag\">$output</code> <em>(string)</em> - the original HTML of the button.</li>\n<li><code class=\"code-tag\">$quick_ajax_id</code> <em>(string)</em> - unique instance identifier.</li>\n</ul>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function customize_load_more_button( $output, $quick_ajax_id ) {\n    $output = &#39;&lt;button type=&quot;button&quot; class=&quot;custom-load-more qapl-load-more-button qapl-button&quot; data-button=&quot;quick-ajax-load-more-button&quot;&gt;Show More Posts&lt;/button&gt;&#39;;\n    return $output;\n}\nadd_filter( &#39;qapl_template_load_more_button&#39;, &#39;customize_load_more_button&#39;, 10, 2 );\n</code></pre>\n<p>This example replaces the <strong>default &quot;Load More&quot; button</strong> with a custom-styled version.</p>"
    },
    "4_finding_debugging_quick_ajax_id": {
        "title": "<h4>Debugging: Find &amp; Log quick_ajax_id for AJAX Hooks</h4>",
        "content": "<p>Each <strong>quick_ajax_id</strong> is unique to an instance of the <strong>Quick Ajax Post Loader</strong> shortcode. It is needed when using hooks and filters to apply changes to a specific shortcode instance.</p>\n<h4>Finding quick_ajax_id in the Page Source</h4>\n<p>To manually find the <strong>quick_ajax_id</strong>, follow these steps:</p>\n<ul class=\"ul-numbered\">\n<li>Open the page where the shortcode is used.</li>\n<li>Right-click on the dynamically loaded posts and select <strong>Inspect</strong> (Chrome) or <strong>Inspect Element</strong> (Firefox).</li>\n<li>Find a <code class=\"code-tag\">div</code> element with an <strong>id</strong> that starts with <code class=\"code-tag\">&quot;quick-ajax-&quot;</code>.</li>\n</ul>\n<p><strong>Example HTML Structure:</strong></p>\n<pre><code class=\"no-background\">&lt;div id=&quot;quick-ajax-p963&quot; class=&quot;quick-ajax-posts-container&quot;&gt;&lt;/div&gt;\n</code></pre>\n<p>In this case, the <strong>quick_ajax_id</strong> is <strong>&quot;p963&quot;</strong>.</p>\n<p>Once you have the correct <strong>quick_ajax_id</strong>, you can use it in hooks and filters to modify only the selected instance of the plugin.</p>\n<h4>Debugging quick_ajax_id</h4>\n<p>If you need to <strong>programmatically find and verify the quick_ajax_id</strong>, use one of the methods below.</p>\n<h4>Display quick_ajax_id in the Browser Console</h4>\n<p>Use this method if you want to debug <strong>quick_ajax_id</strong> directly in your browser.</p>\n<p><strong>Example:</strong></p>\n<pre><code class=\"no-background\">function debug_quick_ajax_id( $args, $quick_ajax_id ) {\n    if (is_user_logged_in()) { // Ensure this is visible only to logged-in users\n        echo &#39;&lt;script&gt;console.log(&quot;Quick Ajax ID: &#39; . esc_js($quick_ajax_id) . &#39;&quot;)&lt;/script&gt;&#39;;\n    }\n    return $args;\n}\nadd_filter( &#39;qapl_modify_posts_query_args&#39;, &#39;debug_quick_ajax_id&#39;, 10, 2 );\n</code></pre>\n<p><strong>How to use it?</strong></p>\n<ul>\n<li>Open <strong>Developer Console</strong> (<code class=\"code-tag\">F12 &gt; Console</code>).</li>\n<li>Look for <strong>&quot;Quick Ajax ID: ...&quot;</strong> message.</li>\n</ul>\n<h4>Log quick_ajax_id in the PHP Error Log</h4>\n<p>If you prefer debugging on the <strong>server side</strong>, log the <strong>quick_ajax_id</strong> into the PHP error log.</p>\n<p><strong>Example: Log quick_ajax_id to wp-content/debug.log</strong></p>\n<pre><code class=\"no-background\">function log_quick_ajax_id( $args, $quick_ajax_id ) {\n    error_log(&#39;Quick Ajax ID: &#39; . $quick_ajax_id);\n    return $args;\n}\nadd_filter( &#39;qapl_modify_posts_query_args&#39;, &#39;log_quick_ajax_id&#39;, 10, 2 );\n</code></pre>\n<p><strong>Where to check logs?</strong></p>\n<ul>\n<li>Enable <code class=\"code-tag\">WP_DEBUG_LOG</code> in <code class=\"code-tag\">wp-config.php</code></li>\n<li>Find logs in <strong>wp-content/debug.log</strong></li>\n<li>Alternatively, check your <strong>server error logs</strong>.</li>\n</ul>\n<p><strong>Warning:</strong> Do not log sensitive data in production.</p>"
    },
    "4_best_practices_hooks": {
        "title": "<h4>Best Practices for Hooks and Filters</h4>",
        "content": "<p>To ensure safe and effective modifications to the <strong>Quick Ajax Post Loader</strong>, follow these best practices:</p>\n<ul>\n<li><strong>Use filters and hooks instead of modifying core plugin files.</strong></li>\n<li><strong>Target only specific instances</strong> using <code class=\"code-tag\">$quick_ajax_id</code>, instead of applying global changes.</li>\n<li><strong>Test all modifications on a staging site</strong> before applying them to a live website.</li>\n<li><strong>Use debugging tools</strong> such as <code class=\"code-tag\">error_log(print_r($args, true));</code> to inspect filter output.</li>\n<li><strong>Check for conflicts with other plugins and themes</strong> when applying modifications.</li>\n<li><strong>Follow WordPress coding standards</strong> to ensure compatibility and maintainability.</li>\n<li><strong>Document your changes</strong> if working in a team or managing multiple sites.</li>\n</ul>\n<p>By following these practices, you can ensure that your custom modifications are <strong>reliable, efficient, and easy to maintain</strong>.</p>"
    },
    "5_ajax_function_generator": {
        "title": "<h4>AJAX Function Generator</h4>",
        "content": "<h4>Description</h4>\n<p>The <strong>AJAX Function Generator</strong> is a tool available in the WordPress admin panel under <strong>Quick Ajax &gt; Settings &amp; Features</strong>, in the <strong>&quot;Function Generator&quot;</strong> tab.\nIt allows you to generate PHP code that can be placed directly in theme files such as <strong>page.php, single.php</strong>, or other page templates.</p>\n<p>The generated code works similarly to shortcodes but provides greater flexibility since it can be embedded in PHP files.</p>\n<h4>Example Code Generated by Function Generator&quot;</h4>\n<p>The following code enables dynamically displaying posts via AJAX without the need to refresh the page.</p>\n<pre><code class=\"no-background\">&lt;?php\n// Define AJAX query parameters for &#39;post&#39; type posts.\n$quick_ajax_args = [\n    &#39;post_type&#39; =&gt; &#39;post&#39;,\n    &#39;posts_per_page&#39; =&gt; 6,\n    &#39;orderby&#39; =&gt; &#39;date&#39;,\n    &#39;order&#39; =&gt; &#39;DESC&#39;,\n    &#39;post__not_in&#39; =&gt; [3, 66, 999],\n    &#39;ignore_sticky_posts&#39; =&gt; 1,\n    &#39;selected_taxonomy&#39; =&gt; &#39;category&#39;,\n    &#39;selected_terms&#39; =&gt; [3, 6, 9]\n];\n\n// Define attributes for AJAX.\n$quick_ajax_attributes = [\n    &#39;quick_ajax_id&#39; =&gt; 15298,\n    &#39;quick_ajax_css_style&#39; =&gt; 1,\n    &#39;grid_num_columns&#39; =&gt; 3,\n    &#39;post_item_template&#39; =&gt; &#39;post-item&#39;,\n    &#39;taxonomy_filter_class&#39; =&gt; &#39;class-taxonomy, filter-class&#39;,\n    &#39;container_class&#39; =&gt; &#39;container-class, my-style&#39;,\n    &#39;load_more_posts&#39; =&gt; 4,\n    &#39;loader_icon&#39; =&gt; &#39;loader-icon&#39;,\n    &#39;ajax_initial_load&#39; =&gt; 1,\n    &#39;infinite_scroll&#39; =&gt; 1\n];\n\n// Set the sort options for the button.\n$quick_ajax_sort_options = [&#39;date-desc&#39;, &#39;date-asc&#39;, &#39;comment_count-desc&#39;, &#39;title-asc&#39;, &#39;title-desc&#39;, &#39;rand&#39;];\n\n// Render the sorting control button.\nif(function_exists(&#39;qapl_render_sort_controls&#39;)):\n    qapl_render_sort_controls(\n        $quick_ajax_args,\n        $quick_ajax_attributes,\n        $quick_ajax_sort_options\n    );\nendif;\n\n// Render the navigation for selected taxonomy.\nif(function_exists(&#39;qapl_render_taxonomy_filter&#39;)):\n    qapl_render_taxonomy_filter(\n        $quick_ajax_args,\n        $quick_ajax_attributes\n    );\nendif;\n\n// Render the grid for &#39;post&#39; type posts.\nif(function_exists(&#39;qapl_render_post_container&#39;)):\nqapl_render_post_container(\n    $quick_ajax_args,\n    $quick_ajax_attributes\n);\nendif;\n?&gt;\n</code></pre>"
    },
    "5_key_functions_parameters": {
        "title": "<h4>Key Functions &amp; Parameters</h4>",
        "content": "<h4>qapl_render_post_container</h4>\n<p>Function responsible for rendering the <strong>grid of dynamically loaded posts</strong>.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><strong>$quick_ajax_args</strong> - WP_Query arguments array.</li>\n<li><strong>$quick_ajax_attributes</strong> - display attributes array.</li>\n</ul>\n<h4>qapl_render_taxonomy_filter</h4>\n<p>Function that generates <strong>filter buttons</strong> for a selected taxonomy.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><strong>$quick_ajax_args</strong> - WP_Query arguments array.</li>\n<li><strong>$quick_ajax_attributes</strong> - display attributes array.</li>\n</ul>\n<h4>qapl_render_sort_controls</h4>\n<p>This function generates <strong>sorting buttons</strong>, allowing users to dynamically change the order of displayed posts without refreshing the page. Users can select different sorting criteria, such as by date, comment count, or title.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><strong>$quick_ajax_args</strong> - WP_Query arguments array.</li>\n<li><strong>$quick_ajax_attributes</strong> - display attributes array.</li>\n<li><strong>$quick_ajax_sort_options</strong> - available sorting options.</li>\n</ul>\n<h4>Advanced Features Tips</h4>\n<ul>\n<li><strong>Test all changes</strong> in a staging environment before deploying them.</li>\n<li><strong>Use the generated code</strong> to avoid errors.</li>\n<li><strong>Customize attributes in the PHP code</strong> instead of relying solely on shortcodes.</li>\n</ul>"
    },
    "6_configuring_ajax_queries": {
        "title": "<h4>$quick_ajax_args - Configuring AJAX Queries</h4>",
        "content": "<p><strong>$quick_ajax_args</strong> is an array of arguments passed to <strong>WP_Query</strong>, which determines which posts are retrieved via AJAX.</p>\n<h4>Available Options:</h4>\n<ul>\n<li><strong>post_type</strong> <em>(string)</em> - the post type to retrieve, e.g., <code class=\"code-tag\">&#39;post&#39;</code>, <code class=\"code-tag\">&#39;page&#39;</code>, or custom post types.</li>\n<li><strong>posts_per_page</strong> <em>(int)</em> - number of items to load per AJAX request.</li>\n<li><strong>orderby</strong> <em>(string)</em> - how to sort the results, e.g., <code class=\"code-tag\">&#39;date&#39;</code>, <code class=\"code-tag\">&#39;title&#39;</code>.</li>\n<li><strong>order</strong> <em>(string)</em> - the order in which posts are sorted, e.g., <code class=\"code-tag\">&#39;ASC&#39;</code>, <code class=\"code-tag\">&#39;DESC&#39;</code>.</li>\n<li><strong>post__not_in</strong> <em>(array)</em> - array of post IDs to exclude from the results.</li>\n<li><strong>ignore_sticky_posts</strong> <em>(bool)</em> - whether to ignore sticky posts.</li>\n<li><strong>selected_taxonomy</strong> <em>(string)</em> - slug of the taxonomy to display in the filter navigation (e.g., <code class=\"code-tag\">&#39;category&#39;</code>, <code class=\"code-tag\">&#39;product_color&#39;</code>).\nEnables rendering of a taxonomy-based filter UI with toggle buttons for terms.</li>\n<li><strong>selected_terms</strong> <em>(array)</em> - array of term IDs that should appear in the filter navigation.\nIf not defined or empty, <strong>all terms</strong> from the selected taxonomy will be included.\nIf defined, <strong>only the specified terms</strong> will be displayed and used for filtering.</li>\n</ul>\n<h4>Example Configuration of $quick_ajax_args</h4>\n<pre><code class=\"no-background\">$quick_ajax_args = [\n    &#39;post_type&#39;           =&gt; &#39;post&#39;,\n    &#39;posts_per_page&#39;      =&gt; 6,\n    &#39;orderby&#39;             =&gt; &#39;date&#39;,\n    &#39;order&#39;               =&gt; &#39;DESC&#39;,\n    &#39;post__not_in&#39;        =&gt; [3, 66, 100],\n    &#39;ignore_sticky_posts&#39; =&gt; true,\n    &#39;selected_taxonomy&#39;   =&gt; &#39;category&#39;,\n    &#39;selected_terms&#39;      =&gt; [3, 6, 9]\n];\n</code></pre>\n<p>This setup fetches <strong>the 6 most recent posts</strong>, ignores <strong>sticky posts</strong>, and excludes posts with <strong>IDs 3, 66, and 100</strong>.</p>"
    },
    "6_configuring_ajax_appearance": {
        "title": "<h4>$quick_ajax_attributes - Configuring AJAX Appearance &amp; Behavior</h4>",
        "content": "<p><strong>$quick_ajax_attributes</strong> defines how dynamically loaded posts are displayed and how users interact with them.</p>\n<h4>Available Options:</h4>\n<ul>\n<li><strong>quick_ajax_id</strong> <em>(int)</em> - a unique identifier for the AJAX instance, allowing multiple independent post grids on a single page.</li>\n<li><strong>quick_ajax_css_style</strong> <em>(int)</em> - enables or disables the built-in Quick Ajax CSS styles.</li>\n<li><strong>grid_num_columns</strong> <em>(int)</em> - defines the number of columns in the post grid.</li>\n<li><strong>post_item_template</strong> <em>(string)</em> - allows selecting a custom post template, e.g., <code class=\"code-tag\">&#39;post-item-custom-name&#39;</code> (use the file name without the <code class=\"code-tag\">.php</code> extension).</li>\n<li><strong>taxonomy_filter_class</strong> <em>(string)</em> - adds custom CSS classes to the taxonomy filter.</li>\n<li><strong>container_class</strong> <em>(string)</em> - adds custom CSS classes to the post grid container.</li>\n<li><strong>load_more_posts</strong> <em>(int)</em> - defines the number of posts to load when the <strong>&quot;Load More&quot;</strong> button is clicked.</li>\n<li><strong>loader_icon</strong> <em>(int)</em> - allows choosing a loading icon.</li>\n<li><strong>infinite_scroll</strong> <em>(int)</em> - enables or disables infinite scroll. When enabled, more posts will automatically load via AJAX as the user scrolls down the page.</li>\n<li><strong>ajax_initial_load</strong> <em>(int)</em> - enables loading the initial set of posts via AJAX on page load. This feature ensures posts are up-to-date, especially in cases of caching issues.</li>\n</ul>\n<h4>Example Configuration of $quick_ajax_attributes</h4>\n<pre><code class=\"no-background\">$quick_ajax_attributes = [\n    &#39;quick_ajax_id&#39;         =&gt; 12056,\n    &#39;quick_ajax_css_style&#39;  =&gt; 1,\n    &#39;grid_num_columns&#39;      =&gt; 3,\n    &#39;post_item_template&#39;    =&gt; &#39;post-item-custom-name&#39;,\n    &#39;taxonomy_filter_class&#39; =&gt; &#39;filter-class&#39;,\n    &#39;container_class&#39;       =&gt; &#39;custom-post-container&#39;,\n    &#39;load_more_posts&#39;       =&gt; 3,\n    &#39;loader_icon&#39;           =&gt; &#39;loader-icon&#39;,\n    &#39;infinite_scroll&#39;       =&gt; 1,\n    &#39;ajax_initial_load&#39;     =&gt; 1\n);\n</code></pre>\n<p>This setup creates <strong>a 3-column post grid</strong>, uses a custom template <strong><code class=\"code-tag\">post-item-custom-name</code></strong>, and loads <strong>4 posts</strong> when clicking <strong>&quot;Load More&quot;</strong>.</p>"
    }
}