Recently, while i was working for one of my client using Shortcodes Ultimate plugin, i noticed that this plugin is missing a pagination feature for the posts.
The blog section of the website was just displaying the posts using the below shortcode
[sourcecode language=”plain”][su_posts template="templates/default.php" posts_per_page="6" tax_operator="0" order="desc"][/sourcecode]
As it was clearly written on the Shortcodes Ultimate Documentation that pagination is not supported, so i decided to tweak the plugin so that i can get the pagination functionality.

Shortcodes Ultimate Documentation Official showing that PAGINATION is not supported
So if you need to add pagination using SHORTCODES ULTIMATE plugin, you have to follow the below steps:
-
- Open File Manager or use FTP client and navigate to “wp-content/plugins/shortcodes-ultimate/inc/core”.
-
- Open shortcodes.php and then download the modified file and replace shortcodes.php with it.
- Download the navigation code and paste it in your theme functions.php.
- Create a folder called ‘templates‘ in your activated theme, preferably in your child theme and upload this file in that.
- Now use the shortcode
[sourcecode language=”plain”][su_posts template="templates/default.php" posts_per_page="6" tax_operator="0" order="desc"][/sourcecode]
If you are still facing issues, you can contact me here ,i will be happy to help you.
Do not forget to leave your comments.
Cheers
3 - 3Shares
Leave your comments and feedback guys.
Hi Amrinder,
your code works wonderfull. I was looking for this solution for a long time. The pagination (page numbers) and the previous page link are displayed correctly, but I have problems with the function for the next page link (get_next_posts_link), this is not displayed! Can you tell me what i did wrong?
Best regards
Stefan
Hello Stefan,
Thanks for trying it out and i am glad it fixed your problem.
Can you try to modify functions.php code you downloaded above and then at the very bottom replace the “get next posts” function with this code
[code lang=php]
/** Next Post Link */
if ( get_next_posts_link() )
printf( '<li>%s</li>' . "\n", get_next_posts_link('<i class="fa fa-chevron-right" aria-hidden="true"></i>',$max) );
echo '</ul></div>' . "\n";
[/code]
Let me know if your problem is solved.
Cheers !
Hey Amrinder,
thanks for the fast respond on sunday 🙂
I have the functions.php modified to two WordPress installations (test versions) – unfortunately without success. The next-page function is still not displayed.
Cheers!
Stefan
Hello Stefan
You can remove the if statement check at the bottom of the navigation code you placed in functions.php
Check the updated code below:
Remove thisif ( get_next_posts_link() )
[code language=”php”]
/** Next Post Link */
printf( ‘<li>%s</li>’ . "\n", get_next_posts_link(‘<i class="fa fa-chevron-right" aria-hidden="true"></i>’,$max) );
echo ‘</ul></div>’ . "\n";
[/code]
Let me know if the problem still persists.
For further assistance, you can contact me with the test website credentials. I will look into that and will let you know how to go about it.
https://www.developingsense.com/contact-us/
Cheers !
Hello Amrinder,
now it works wonderfull – thank you very very much for your help 🙂
Best regards
Stefan
is a great contribution
Thanks Jose
Hi,
Good job! It works very well… the only problem I have is that the current page is not marked on the pagination. Did I missed something during the installation?
Thank you.
Hello Dariusz,
Thanks for the appreciation.
With the code on functions.php it will add class “active” on the li tags. So, i guess you need to give it a bit of css. Add this to your custom css file in the active theme.
For example:
[code language=””]
.pagination ul li.active a {
color: #fff;
background: #178793;
}
[/code]
This will give styling and will display the current page. Let me know if this fixes your problem.
You can Contact me. if your problem persists with your site url.
Amazing. Thank you so much. It works perfectly right now.
Cheers Dariusz 🙂
Thanks for you help, Jha Bless!
Hellow, I have gone thru your post it is helpful…but to my side i do not find shortcodes.php. As you may see on this file image>>http://www.clipular.com/posts/5085319939227648?k=FX48sRsPFZY3Qd3VcgHSG5FRN5w
Hello, Kindly contact me through my contact us page for more help.
Hi Amrinder, Great tutorial, but I think you should update it. Latest Shortcodes Ultimate plugin doesn’t have shortcodes.php file?
Hey yes, i will update this ASAP. Thanks for letting me know.
Works great, thanks!
Glad it worked for you.