Postback redirect through add_action is not triggered

Let’s say your site’s address is example.com. When you want to redirect to example.com/page/subpage you should use site_url(‘/page/subpage’). I assume the WordPress address is http://127.0.0.1:8000. You have in your code site_url( ‘http://127.0.0.1:8000/?page_id=5’ ) and it will be converted to this address: http://127.0.0.1:8000http://127.0.0.1:8000/?page_id=5. Try using this redirection: wp_safe_redirect( site_url( ‘/?page_id=5′ ) ); Second issue, if you’ll … Read more

(Divi): How to make WordPress load images of specific size for Blurb modules on given page with a funciton?

Elegant Themes (Divi) recommend a maximum width of 550px for blurb images (https://www.elegantthemes.com/blog/divi-resources/the-ultimate-guide-to-using-images-within-divi). So you should be resizing your images according to those guidelines for the images that you know will be used in your blurbs. This will ensure that your images don’t cause WordPress too much memory effort to resize them on the fly, … Read more

Replace theme function

If the Theme is well developed they wrapped functions in an if (!function_exists(something)) So the you can overwrite just the function by having it in your child themes function.php You may also check if your theme provides hooks and filters to customize behaviour. If that isn’t the case you can either do what you already … Read more

Adding Custom Body Class for Page: Shop

you could try to use this: add_filter(‘body_class’, ‘custom_body_class’); function custom_body_class($classes) { global $post; if ($post->ID == 346) { $classes[] = ‘services’; } return $classes; } This can be used anywhere as its pulling the global variable first.