Create a simple GET endpoint Create a simple POST endpoint Authenticating the current user in a call to the endpoint A REST api request is by default non-authenticated. If you want to use things like get_current_user_id() in your endpoint handling code, you need to pass a nonce to the endpoint when calling it. If using […]
Category: Pages
Alter Page
Use A Shortcode You can add a shortcode to the page and a function for it to add dynamic content, javascript, etc
Creating an API URL
You may want a url to be used for say remote devices to connect to your site and pass information using say URL parameters and a response string. You can create a special url and trap it using the code below. However for it to work in all instances you need to have a real […]
Detect Page
Is the users page ####?
Homepage
To create a customised homepage copy your index.php file and call it home.php. WordPress will use home.php for the home page of your site if it finds one, otherwise it will use index.php (there is also a more complicated way by changing settings). Showing posts from a specific category on the homepage Add this before […]
Post
Individual Post File single.php Showing the posts featured image Use this in single.php: <?php //>>>>> SPECIAL – SHOW THE FEATURED IMAGE if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ); /*Size is set in style.css*/ } //<<<<< ?> To set the size and use […]
Redirect to page
Before outputting page content Redirect based on the home URL Redirect based on the site URL If you’ve outputted some page content Using a META tag is the easiest way Redirect on “Page not found” Create a page called 404.php. Place this code in it:
Redirect WordPress default pages
WP Login Page Redirect
WordPress install sub folder
Getting the sub folder install location for WordPress if its not installed in the site root