I have implemented LIKE and UNLIKE buttons on a post page, where the LIKE button submits a form to create a CPT using a page reload, and the UNLIKE button deletes the CPT without a page scroll due to AJAX. I want to improve the UX by using JavaScript for a page refresh upon successful form submission.
Solution:
To reload the page after a successful form submission without a clunky scroll, use jQuery’s ajaxComplete event to trigger a JavaScript reload. This will refresh the page only after the AJAX request completes.
This approach triggers a refresh right after the AJAX completion, maintaining the user's scroll position.
I want to remove the author name, date, and post navigation (previous/next post) from my content template on specific posts.
Solution:
For Navigation (Previous/Next Post): In your content template, search for the code responsible for post navigation, usually found near . Remove or comment out this section to disable the navigation links.
For Author Name and Date: These elements are likely generated by the Astra theme. Check the Astra theme options in the WordPress Customizer (Appearance > Customize) for settings to hide the author and date. If no option exists, contact Astra support for further assistance.