dudaster / ele-custom-skin

Create a skin for Elementor Pro Post and Post Archive widgets using Elementor templates
GNU General Public License v3.0
59 stars 10 forks source link

Sorting posts by current query then limiting no. of posts shown #197

Open gdoddsldn opened 4 years ago

gdoddsldn commented 4 years ago

Hi,

I'm trying to use the Pro custom skins on a category listing, and am using Elementor's theme builder in order to manage this. The plugin works nicely until I filter the results by 'Current Query', then it seems to ignore the 'Number of posts to show' option.

Example: https://s32182.p980.sites.pressdns.com/category/finance/ - here the top section should only have 1 visible post.

dudaster commented 4 years ago

Does the classic skin behaves the same?

gdoddsldn commented 4 years ago

No, all works as normal there. Only happens when using the plugin loops.


From: Liviu Duda notifications@github.com Sent: 01 May 2020 18:24 To: dudaster/ele-custom-skin ele-custom-skin@noreply.github.com Cc: Geoffrey Dodds G.Dodds@business-reporter.co.uk; Author author@noreply.github.com Subject: Re: [dudaster/ele-custom-skin] Sorting posts by current query then limiting no. of posts shown (#197)

Does the classic skin behaves the same?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dudaster/ele-custom-skin/issues/197#issuecomment-622480453, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APNHEEX7RPCED4N3WFTVXQDRPMATRANCNFSM4MXD6N3A.

dudaster commented 4 years ago

What about using a simple loop template?

gdoddsldn commented 4 years ago

I’ve just updated the page to a loop that just includes the title, the problem still persists.

dudaster commented 4 years ago

I've just pushed a new version out. Please update and let me know if the issue is fixed.

gdoddsldn commented 4 years ago

Unfortunately it’s still happening.

Cleared the cache etc. after installing the update.

From: Liviu Duda notifications@github.com Reply to: dudaster/ele-custom-skin reply@reply.github.com Date: Monday, 4 May 2020 at 10:05 To: dudaster/ele-custom-skin ele-custom-skin@noreply.github.com Cc: Geoffrey Dodds G.Dodds@business-reporter.co.uk, Author author@noreply.github.com Subject: Re: [dudaster/ele-custom-skin] Sorting posts by current query then limiting no. of posts shown (#197)

I've just pushed a new version out. Please update and let me know if the issue is fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dudaster/ele-custom-skin/issues/197#issuecomment-623346705, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APNHEEV3546J3T7XJD4GY3DRP2AMXANCNFSM4MXD6N3A.

dudaster commented 4 years ago

It seems when you use Current Query the number of posts cannot be set inside the Post Widgets. You can only set it in Wordpress Settings > Reading

But fortunately you can use Elementor custom query to make a hook and filter the current query: https://developers.elementor.com/custom-query-filter/

In your case you case you can use this code:

// change the number of posts per page in elementor qustom query
add_action( 'elementor/query/my_pagination', function( $query ) {
    $query->set( 'posts_per_page', 1 );
} );

in your child theme's function.php .

And add it in your query tab: Screen Shot 2020-05-04 at 5 55 08 PM

turbit-smart commented 4 years ago

wow, thanks your small tip helped me big time, I just changed the number in here and all fixed Wordpress Settings > Reading before couldn't' control the amount throw the widget