Create many pages with dynamic content based on 1 template

In case the Multisite functionality of WordPress is an option for you, then that would be the perfect use case for the template functionality of WordPress. You install your template on the multisite, “activate it for all sites” to be used and voilà, it should change on all “networksites”. See the official documentation as a … Read more

How to transfer a site to hosting?

The host often places a default “index.html” file in a public folder such as “www” or “public_html”. It’s often in the same folder as your root WordPress install and its “wp-config.php” file. If you find and delete it, this should let your WordPress install provide the homepage. (One other option in this case is to … Read more

How to change default home link title?

For some reason this code has been added: <h1 class=”entry-title”><?php echo the_title(); ?></h1> the_title will display the current posts title, you should replace this with what you actually want. If you wanted to remove this completely with no replacement just delete this line. Also, this doesn’t appear to be a link at all, just a … Read more

if is_page() is not working with wp_redirect

In the case of a plugin template, you might find the slug is more reliable for a condition – see below for alternate approach. When using is_page_template() the parameter passed is anypath/filename.php. Without knowing your file system specifics or the name of the plugin, it is impossible to give you the correct relative path for … Read more

Updating page template pragmatically

Use the body_class filter to change the <body> CSS classes. You can copy the same logic into your hooked function (like below), or make it neater by copying the logic into another new function and make this function return a boolean (and then use that new function with the body_class filter and within your template_redirect … Read more

Restrict specific private page to a specific user

I assume you’re using wp_insert_post() to create the private page for the user. The function returns the ID of the created page. You can use this ID as part of a custom capability you grant to the user. // create the new $user // create private page $private_page_id = wp_insert_post( $postarr, $wp_error = false ); … Read more