Git Product home page Git Product logo

dcooney / ajax-load-more Goto Github PK

View Code? Open in Web Editor NEW
234.0 17.0 73.0 13.44 MB

Infinite Scroll with Ajax Load More. The ultimate solution to add infinite scroll functionality to your WordPress powered website.

Home Page: https://connekthq.com/ajax-load-more/

License: GNU General Public License v2.0

PHP 31.83% JavaScript 60.86% SCSS 7.31%
infinite-scroll wordpress-ajax wordpress lazy-loading endless-scroll wordpress-plugin infinite-scroll-plugin shortcode

ajax-load-more's Introduction

WordPress Ajax Load More

Ajax Load More is the ultimate solution for infinite scrolling and lazy loading posts, custom post types and pages with Ajax powered queries.

Build complex WordPress queries using the Ajax Load More custom shortcode builder then add the shortcode to your pages via the content editor or directly into your template files.

Get More Information

Download Instructions

Ajax Load More is available as an installed plugin on wordpress.org. Please download the latest stable version from your WordPress plugins dashboard by searching for Ajax Load More or visiting https://wordpress.org/plugins/ajax-load-more/.

Features

  • Shortcode Builder - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder.(see Shortcode Parameters).
  • Query Parameters - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
  • Customizable Repeater Templates - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots).
  • Setting Panel - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
  • Multiple Instances - You can include multiple instances of Ajax Load More on a single page, post or template.

Check out the demo site for more information!

Shortcode Parameters

Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your shortcode is simple with our intuitive Shortcode Builder.

  • repeater - Choose a repeater template (Add-on available). Default = ‘default’
  • theme_repeater - Select from a list of template files in your current theme directory (Add-on only). Default = null
  • post_type - Comma separated list of post types. Default = ‘post’
  • post_format - Query by post format. Default = null
  • category - A comma separated list of categories to include by slug. Default = null
  • category__not_in - A comma separated list of categories to exclude by ID. Default = null
  • tag - A comma separated list of tags to include by slug. Default = null
  • tag__not_in - A comma separated list of tags to exclude by ID. Default = null
  • taxonomy - Query by custom taxonomy name. Default = null
  • taxonomy_terms - Comma separated list of custom taxonomy terms(slug). Default = null
  • taxonomy_operator - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
  • day - Day of the week. Default = null
  • month - Month of the year. Default = null
  • year - Year of post. Default = null
  • taxonomy_operator - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
  • meta_key - Custom field key(name). Default = null
  • meta_value - Custom field value. Default = null
  • meta_compare - Operator to compare meta_key and meta_value against. Default = ‘IN’
  • meta_type - Custom field type. Default = ‘CHAR’
  • meta_relation - Used with multiple custom field entries (AND/OR). Default = ‘AND’
  • author - Query by author id. Default = null
  • post__in - Comma separated list of post ID’s to include in query. Default = null
  • exclude - Comma separated list of post ID’s to exclude from query. Default = null
  • search - Query search term (‘s’). Default = null
  • custom_args - A semicolon separated list of value:pair arguments. e.g. tag_slug__and:design,development; event_display:upcoming. Default = null
  • post_status - Select status of the post. Default = 'publish'
  • order - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’
  • orderby - Order posts by date, title, name, menu order, random, author, post ID or comment count. Default = ‘date’
  • offset - Offset the initial query (number). Default = ’0′
  • posts_per_page - Number of posts to load with each Ajax request. Default = ’5′
  • scroll - Load more posts as the user scrolls the page (true/false). Default = ‘true’
  • scroll_distance - The distance from the bottom of the screen to trigger the loading of posts while scrolling. Default = '150'
  • max_pages - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '5'
  • pause_override - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null
  • pause - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
  • transition - Choose a posts reveal transition (slide/fade/none). Default = 'slide'
  • images_loaded - Wait for all images to load before displaying ajax loaded content (true/false). Default = 'false'
  • destroy_after - Remove ajax load more functionality after 'n' number of pages have been loaded. Default = null
  • button_label - The label text for Load More button. Default = 'Older Posts'
  • container_type - Override the global Container Type that was set on ALM Settings page. Default = null
  • css_classes - Add custom CSS classes to the Ajax Load More container. Default = null
  • cache - Turn on content caching for the specific Ajax Load More query. add-on only - (true/false). Default = ‘false’
  • cache_id - A unique 10 digit ID for the cached query. add-on only - Default = A random 10 digit integer
  • seo - Enable address bar URL rewrites as users page through content - add-on only (true/false). Default = ‘false’
  • preloaded - Should Ajax Load More preload posts? add-on only - (true/false). Default = ‘false’
  • preloaded_amount - The amount of posts to preload. add-on only - Default = ‘5’
  • paging - Replace infinite scrolling with a paged navigation system. add-on only (true/false). Default = ‘false’
  • paging_controls - Show previous(«) and next(») buttons (true/false). Default = ‘false’
  • paging_classes - Add classes to the paging navigation menu for CSS styling.
  • paging_show_at_most - Maximum amount of pages to show at a time. 0 = no maximum. Default = ‘0’

Example Shortcode

[ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"]

Demos

  • Default - Out of the box functionality and styling
  • Destroy After - Remove Ajax Load More functionality after 'n' number of pages
  • Fade Transition - Elements fade in as posts are loaded
  • Filtering - Reset and filter an Ajax Load More instance
  • Masonry - Creating a flexible grid layout with Masonry JS
  • Multiple Instances - Include multiple Ajax Load More' on a single page
  • Paging URLs - Generate unique paging URLs for every Ajax Load More query with the SEO add-on
  • Pause Loading - Posts will not load until initiated by the user
  • Preloaded Posts - Easily preload an initial set of posts before completing any Ajax requests to the server
  • Search Results - Returning results based on search terms
  • SEO & Paging - Combine these two add-ons to create one powerful navigation system
  • Slideshow Gallery - Create a gallery of posts with Ajax Load More and the Paging add-on.

The Custom Repeater Add-On has been installed for use on each of our product demos

Add-ons

The following Add-ons are available to increase the functionality of Ajax Load More.

Custom Repeaters

The Custom Repeaters add-on will allow for unlimited repeater templates and provide the ability to create unique templates for different content types throughout your theme.
Get More Information

Cache

The Cache add-oncreates static HTML files of Ajax Load More requests then serves those static pages to your visitors without querying the database.
Get More Information

Paging

The Paging add-on will transform Ajax Load More’s lazy load/infinite scroll functionality into a robust ajax powered navigation system.
Get More Information

Preloaded

The Preloaded add-on will allow you to quickly and easily preload an initial set of posts before completing any Ajax requests to the server.
Get More Information

Previous Post

The Previous Post add-on will allow you to navigate single posts with Ajax Load More.
Get More Information

Search Engine Optimization

The SEO add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.
Get More Information

Theme Repeaters

The Theme Repeaters add-on will allow you load, edit and maintain templates from your current theme directory.
Get More Information

Tested Browsers

  • Firefox (Mac, PC)
  • Chrome (Mac, PC, iOS, Android)
  • Safari (Mac, iOS)
  • IE8+
  • Android (Native)
  • BB10 (Native)

Website =

http://connekthq.com/ajax-load-more/

ajax-load-more's People

Contributors

bryant1410 avatar crissoca avatar dcooney avatar dependabot[bot] avatar dmitry-christie avatar maki10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ajax-load-more's Issues

Applying jQuery to dynamically loaded elements (Premium User)

Hi there

Very happy with the functionality provided by this script, but need a little help applying a function after the extra posts have loaded.

We're using the following code to ensure images in a responsive site are always proportional:

var imagesizes = function () {

    var projW = $('.project-overview .image-wrap').width() * 0.85;
    $(".project-overview .image-wrap").css({ 'height': projW});

};

$(document).ready(imagesizes);
$(window).resize(imagesizes);

So far, so good. However, I've been struggling to get this to apply to the posts loaded by Ajax Load More. I've tried using an if statement and "$finished = false", before running the image size function again, but no good.

When I resize the browser window, after loading more posts, they get dynamically resized – so we're nearly there. I've tried attaching the same function to an "click" event, to activate when the load more button is pushed, but that doesn't work either.

Any ideas appreciated!

Thanks in advance,
James

Any idea why it wouldn't work in IE9?

I've implemented this on a couple of sites, and it works great but for some reason neither site is loading posts in IE9.

I'm assuming this a problem on my end, as your example page works fine in IE9.

Any idea where I might start looking for issues?

Warning: require_once(../../../../wp-load.php)

Hi there,

Thanks for share this 👍 how can i import it, i tried but was not successful:

Warning: require_once(../../../../wp-load.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\wordpress2\wp-content\themes\remix\ajax-load-more\ajax-load-more.php on line 19

Fatal error: require_once() [function.require]: Failed opening required '../../../../wp-load.php' (include_path='.;C:\php5\pear') in C:\wamp\www\wordpress2\wp-content\themes\remix\ajax-load-more\ajax-load-more.php on line 19

Cheers,
Behzad

Write permissions on WPEngine

Getting multiple write errors in my error log on WPEngine. I've reset file permissions and contacted their support about it. Setting the permissions to 777 isn't allowed on their system. The settings in Wordpress though has the green light for write permissions but still getting the errors. Here are the error messages:

[Fri Nov 14 14:58:22 2014] [error] [client XXX] PHP Warning: fopen(/nas/wp/www/cluster-2759/DOMAIN/wp-content/plugins/ajax-load-more/core/repeater/default.php) [function.fopen]: failed to open stream: Permission denied in /nas/wp/www/cluster-2759/DOMAIN/wp-content/plugins/ajax-load-more/admin/admin.php on line 77, referer: http://www.DOMAIN.com/news/
[Fri Nov 14 14:58:22 2014] [error] [client XXX] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in /nas/wp/www/cluster-2759/DOMAIN/wp-content/plugins/ajax-load-more/admin/admin.php on line 78, referer: http://www.DOMAIN.com/news/
[Fri Nov 14 14:58:22 2014] [error] [client XXX] PHP Warning: fread() expects parameter 1 to be resource, boolean given in /nas/wp/www/cluster-2759/DOMAIN/wp-content/plugins/ajax-load-more/admin/admin.php on line 79, referer: http://www.DOMAIN.com/news/
[Fri Nov 14 14:58:22 2014] [error] [client XXX] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /nas/wp/www/cluster-2759/DOMAIN/wp-content/plugins/ajax-load-more/admin/admin.php on line 80, referer: http://www.DOMAIN.com/news/

Anybody else run into this issue before and know of a workaround?

Use in custom archive

Is it possible to add this "the developers way" to archive.php?

(so not working with shortcodes)

How to create a repeater with custom php query function?

Hello. This is not an issue but rather a request on how to create a repeater block with a custom php query function. I apologize if I use here some wrong terms related to programming as I'm not a developer.

Well, I use a theme which supports custom post types and it uses a built in configuration of (options tree plugin) to manage the theme options as also the custom fields for its "Food" custom post type and taxonomy.

Although the plugin works great, I'm not able to re-create the same query function that is used by my theme's page template for the repeater itself. What I mean is I need to create a repeater template which is capable to display the same custom fields my theme's custom post type supports.

Here's a pastebin of the php template with the custom query function for my theme's custom post type: http://pastebin.com/z8snU0ET

If I copy the <li></li> piece of code and build a repeater template with it, then the plugin successfully loads more posts with the same style as my theme's, however, it simply ignores the price meta which is being managed by the theme's custom query function.

I'd really appreciate any help in order to make my site function properly with the plugin.

Thanks a lot in advance.

Post order and orderby

Please, add a feature to order posts by id/title/rand/date. It is useful to use the plugin in the related posts area for example. Btw, nice plugin. Thanks a lot.

Idea: Disable Button after all Posts loaded

Hi there,

very nice small and effective enhancement for wordpress!

Is it possible to somehow disable the loading button after all posts have loaded? Maybe by adding a data parameter with the count of all present published posts?

First load ajax

Hello,

I hope you're fine mr. dcooney, Could you please remove ajax/java script from first load of posts, then ajax can work after scroll or clicking on load button.

Again thanks for this great plugin.

Cheers

Feature Request: Allow manipulation of JS parameters

Thanks for creating this plugin - purchased the Custom Repeaters add-on and it's saving me a ton of time!

One issue I'm running into though: I'm using the plugin in "non-standard" ways, and I need to be able to tweak JS parameters on the fly (things like "page", "$finished", etc), but because these are private and no object reference is returned during initialization, I need to resort to hacking your JS.

Making these variables public and returning a reference to the object would make this plugin even more versatile. Perhaps store an object reference as $(".ajax-load-more-wrap").data('alm')?

Thanks!

Feature Request: Hide Shortcode-button in Editor

Hi,

I would like to see an option in the settings, that removes the AJL-button from TinyMCE. I don't want my clients to see it, as I'll implement all buttons in the Theme.

Follow-up question: Is there a filter that lets me hide/remove it?

Feature Request: Support orderby meta values

As a user, I sometimes have Wordpress queries that are ordered by meta value. This could be the date that an event is happening or the price of a product, for example. It would be great if Ajax Load More supported the orderby parameters "meta_value" "meta_compare"

multiple filtering options

Allow for filtering and sorting options like :
meta compare posts AND order by date
where date comes before meta compare.
Example:
1)show first the today posts with x>y, than show yesterday posts with x>y, etc

2)orderby meta, and discard posts older than X

Load more button not fading out when no more posts to load.

Hey there, I'm not sure what I am doing wrong but once there are no more posts loaded, the load more button isn't fading out like the demo shown. I haven't changed any of the css or javascript in the plugin. Any extra guidance would be appreciated.

thanks!

-Jesse

( ! ) Warning: require_once: failed to open stream: No such file or directory

I have generated a plugin in WP MVC framework and its creating some problems.
FIrst i need to clarify something:

My plugin is named W2Store. It has three tables connected to it via database w2store. The tables are:
wp_w2store_countries, wp_w2store_currencies, wp_w2store_zones.

I generated scaffold to create models Country, Currency and Zone. It didnt work for either view or add options. View options did nothing while add option generated an error as field not found in form for input.
So, i again did the work with scaffolding with model names starting with W2SCountry, W2SCurrency and W2SZone.

Now, when i click the add new option, it generates a warning message as follows:

( ! ) Warning: require_once(/var/www/html/wordpress/wp-content/plugins/wp-mvc/core/models/country.php): failed to open stream: No such file or directory in /var/www/html/wordpress/wp-content/plugins/wp-mvc/core/mvc_file_includer.php on line 152

How could it be solved? Any suggestions, ideas, directions....etc?

ALM: not working with WPML

Hi,

I'm using ALM and WPML on a site, and noticed that ALM does not load posts in Firefox and Safari (on a Mac) when WPML is active. Works fine in Chrome, for some reason. Delving into the code, I discovered that admin-ajax.php needs the $lang variable in the GET-request.

I managed to modify the request, by adding WPML’s language parameter (if it exists) like so:

$lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';

I added it just before return in alm_shortcode() and then modified the alm_query_posts() to pass it along to ajax-load-more.js. Now ALM works with WPML.

I can make gists of the modified files, if anyone wants them.

'data-tag' feature not working

Can't seem to get the tag feature to work.

My code:

This works:

<div id="ajax-load-more">
        <div class="listing" 
                data-path="<?php echo get_stylesheet_directory_uri(); ?>/ajax-load-more" 
                data-post-type="news" 
                data-display-posts="12" 
                data-scroll="true" 
                data-button-text="Load More News">
        <!-- Ajax Posts Will Load Here -->
        </div>
</div>

This doesn't:

 <div id="ajax-load-more">
        <div class="listing" 
                data-path="<?php echo get_stylesheet_directory_uri(); ?>/ajax-load-more" 
                data-tag="<?php single_tag_title(); ?>" 
                data-display-posts="12" 
                data-scroll="true" 
                data-button-text="Load More">
        <!-- Ajax Posts Will Load Here -->
        </div>
</div>

It works great when just querying post types, but when trying to drill down to just a single tag it doesn't return anything.

Multiple Instances on One Page?

This works pretty well for me in general - really smooth , really crisp. The only issue I'm having is using this for multiple instances on the same page.

I basically have two columns - I need to query different post types in each column. If I do this now, I only receive one post type and the "Older Posts" button is displaced.

Any thoughts on using this for multiple instances?

Safari 7.1 + Firefox 33.03

Script was working nicely on all browsers until latest updates. On Safari 7.1 I now get this error:

<title>403 Forbidden</title>

Forbidden

You don't have permission to access /wp-admin/admin-ajax.php on this server.

Working absolutely fine in Chrome.
Hosted on WP Engine.

Quick fix appreciated!

Wrapping alternative

Hi... I say thank you for make this great plugin.

But I'm curious about wrapping technique... and the revealed problem that I have to face.

  1. Is it possible to make wrap the code with just div instead of ul and li ?
<section id="ajax-load-more">
    <div class="listing" data-path="<?php echo get_template_directory_uri(); ?>/ajax-load-more" data-post-type="post" data-category="" data-taxonomy="" data-tag="" data-search="" data-display-posts="2" data-scroll="true" data-max-pages="5" data-button-text="<?php _e('Older Posts', 'framework'); ?>" data-transition="slide">
    <!-- Load Ajax Posts Here -->
        <div class="post"></div>
    </div><!-- end .listing -->
</section>



  1. Can we get rid of items wrapper of: "_ajax_load_reveal"
<div class="_ajax_load_reveal">
    <li>Item</li>
</div>

Basically, I just want the ajax will load the post just like this:

<ul>
<!-- Page 1 -->
    <li></li>
    <li></li>
    <li></li>
    <li></li>
<!-- Page 2 -->
    <li></li>
    <li></li>
    <li></li>
    <li></li>
<!-- Page 3 -->
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>

Thanks in advance

load more not shown

I tried to install "wordpress-ajax-load-more" on the default theme of wordpress (Twenty Fourteen), but the button "Load More" does not appear.

Can you help me?
Thanks.

1 I put the "ajax-load-more.php" in the theme (Twenty Fourteen) folder.
2 I put the following code in the index.php files of theme (Twenty Fourteen):

  1. I put the function.js in the js folder

Author template, loads multiple of same post

Awesome plugin, it works perfectly on almost every page, except i'm getting unexpected results on author.php for some reason.

While developing I have display posts set to 1. But when on author.php i click it loads the rest of the authors posts. And then when clicked again it loads a duplicate and then when clicked again - a final duplicate before adding the .done class...

Very strange behavior, any ideas why?

How can add ability to query by term

Hi Darren,

first, thank you for this solution ... very helpful.
I'm trying to add ability to query by term, but it doesn't work (I'm newbie with php/wordpress)
So, in ajax-load-more.php, I'm adding:

$term = (isset($_GET['term'])) ? $_GET['term'] : '';
in "Set up our variables from ajax-load-more.js" section and

if(!empty($term)){
$args['term'] = $term;
}

just above query_posts($args);

In ajax-load-more.js I'm adding

term: $content.attr('data-term'),

In WP template, I have this:
div class="listing" data-path="/ajax-load-more" data-post-not-in="" data-post-type="success-stories" data-category="" data-taxonomy="success_stories_category" data-term="slug; ?>" data-display-posts="2" data-scroll="false" data-button-text="Load More Posts"

But it's return all posts in the taxonomy instead those with the current term.
Can you please point me what I'm doing wrong?

Thanks,
Vel

Load more Button inactive

Hi dcooney,

I integrated your plugin and it is awesome. the only problem i am having is that even if there are more posts the button will be "inactive" and you can't click it. Do you know why that is happening?

Load more order by random

Hi sir , This plugin so very helpful . But there's a problem with regard to the order by rand . Once I clicked the Load more some of the items duplicate . Is there a change that we can exclude the first items load more then load another items

We will appreciate you quick response.
Thanks

Archive pages (author / category) not filtering the posts properly.

Hey there, first off thanks for the plugin. One issue I can't seem to figure out though. How would I go about initiating the plugin to work properly with author posts and category posts? Right now it's just loading all the posts instead of filtering through the author and category specific posts. I saw there was a similar issue a while ago, and I believe I have the most current version of the plugin.

I tried adding

data-category="category" data-author="author" in author.php / category.php but no luck. Any direction would be greatly appreciated.

thanks again,

Jesse

How to fetch and show posts all at once instead of one-by-one

I recently saw some bug fixes so I updated my .js with your latest.

But now I saw the posts getting loaded one-by-one. Since I use it my sidebar as list of latest posts with load more. Loading each post title one by one looks bad.

How to avoid this, and also you your latest .js file which have bug fixes.

Losing repeaters when update plugin

Hi. When I need to update the plugin for the last version, the default and my custom repeaters templates are losing. Please, correct this. :)

Properties in "complete" callback inaccessible

Not sure if I should be posting support requests here. I'm using a jQuery callback function like so:

$.fn.almComplete = function(alm){
    console.log(alm);
    console.log(alm.finished);
}

The first console.log shows "finished: true", however the second console.log outputs false. How do I access the properties of the alm object?

Add additional <ul> class

Hi dcooney,
I am playing around with your plugin, and am trying to insert additional < ul > class.
Right now response is:

    Is there a way to hack into this?
    Thank you for the great plugin.
    Cheers!

Sort by meta_key

Hi Darren,

In order to sort by meta_value, the meta_key needs to be passed to the query. Now, it is only passed if there is a complete meta_query.

Fix: In ajax-load-more.php add to alm_query_posts:

      // Meta_key
        if(!empty($meta_key)){
            $args['meta_key'] = $meta_key;
        }

Limit number of posts

First off, killer plugin.
We have several posts on our site but the design I've received would really only work with an initial load of a handful of posts and then clicking the load button once for one more set of posts. Is there any way to limit the number of posts. I just want the user to be able to click the Load More Posts button once, show the next handful of posts, and then the button change from Load More Posts to something like View Archive and then link to the archive page. Thoughts?

Search implementation?

Hi Darren,
first I want to thanks you about great plugin. I have one question about it. Can I implemented some how than plugin in search.php? For example when I type a keyword to show me first 2 result with load more button? Thank you one more time.

Category Template shows all posts

Is it setup to only show posts of the current category page i am on? Because i am seeing all posts on my blog on each category page.

Improvements to get CAT, TAG, SEARCH and DATE

Hi

Here my custom version of the template to get values from request.
Notice that I put the new tag data-date to get the query values from calendar or month combo archive.

<section id="ajax-load-more">
    <div id="post-area">
        <div class="listing" data-path="<?php echo get_template_directory_uri(); ?>/ajax-load-more" data-post-type="post" data-category="<?php if (isset($_REQUEST["cat"])) echo($_REQUEST["cat"]); ?>" data-date="<?php if (isset($_REQUEST["m"])) echo($_REQUEST["m"]); ?>" data-taxonomy="<?php if (isset($_REQUEST["s"])) echo($_REQUEST["s"]); ?>" data-tag="<?php if (isset($_REQUEST["tag"])) echo($_REQUEST["tag"]); ?>" data-display-posts="<?php echo get_option('posts_per_page'); ?>" data-scroll="false" data-button-text="<?php _e('Next page','default'); ?>"></div>
    </div>
</section>  

At now don't work, but I near to implement it.
I'm working on it:

$args = array( 'post_type' => $postType, 'category_name' => $category, 'author' => $author_id, 'posts_per_page' => $numPosts, 'paged' => $page, //'year' => $year, //'monthnum' => $month, 'orderby' => 'date', 'order' => 'DESC', 'post_status' => 'publish', 'ignore_sticky_posts' => true, );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.