John Davidson

php - Can I change the portfolio default pagination of Divi / Wordpress?

0 comments
Message:


I'm building a website with Divi theme in Wordpress. I want to change the "previous" and "next" words of the portfolio pagination for a "<<" and ">>" arrows. I've tried with the wp-pagenavi plugin but is not working.


Is there any way to do that with php in the functions.php of the child theme?


thanks!



My Answer:
Yes, you can change the default pagination of the Divi portfolio in WordPress by adding some custom PHP code to your child theme's functions.php file. Here's an example of how you can change the "previous" and "next" words to "<< " and ">> " arrows:

php
function custom_portfolio_pagination_text( $args ) {
$args['prev_text'] = '<<';
$args['next_text'] = '>>';
return $args;
}
add_filter( 'et_pb_portfolio_pagination_args', 'custom_portfolio_pagination_text' );


Simply add this code to your child theme's functions.php file and save the changes. This code will replace the default "previous" and "next" words with "<< " and ">> " arrows in the portfolio pagination of your Divi theme.

Rate this post

5 of 5 based on 6942 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us