Navigate to external link if last page or post in a category

Since it’s not clear exactly what you need it’s hard to give you the best solution. However … You should be able to use get_next_posts_link() in your loop template. Or get_previous_posts_link() if that’s what you want. If that returns null you can then echo a link to whereever you want in your template. if(!get_next_posts_link()) { … Read more

Dynamic sidebar areas not working on the Theme Customizer

Creating new query objects is not a good idea in this situation. Try simply getting the pages and using those objects to serve up the widget areas: add_action( ‘widgets_init’, ‘my_243057_widgets_init’ ); function my_243057_widgets_init() { /** * Get only published page objects * @link: https://codex.wordpress.org/Function_Reference/get_pages */ $pages = get_pages(); foreach ( $pages as $page ) { … Read more

Woocommerce Custom Checkout

You can create a custom page and add that custom page url in below function. So all WP “Proceed to Checkout” will go to the custom page. And in that page you can have a link to Final Cart Page and add the checkout link there. add_filter(‘woocommerce_get_checkout_url’, ‘wpse_redirect_checkout’); function wpse_redirect_checkout($url) { global $woocommerce; $checkout_url=”http://www.example.com/custom-checkout-page”; return … Read more