How to implement my custom development multiple PHP page work into WordPress?

You can integrate your PHP file into WordPress with various ways like you can create a plugins and activate plugins and then you get all your PHP file accessible to WP functions. It’s bit dirty but in your case if you wish you add require_once(rtrim($_SERVER[‘DOCUMENT_ROOT’], “https://wordpress.stackexchange.com/”) . ‘/wp-load.php’); on top of the files or if … Read more

Force a specific template as default

Instead of setting yourtemplate.php as the default, why don’t you change the default template, and put the original default in yourtemplate.php? AKA swap them? Otherwise you’ll have to go back through all your posts and change them, and, mess around with complicated filters that might not work 100%

Why still output /wp-content/themes/twentynineteen?

You need to deactivate and reactivate your theme. When a theme is activated the template and stylesheet values are set in the database. If you remove Template: from the child theme’s stylesheet, the template is still set to twentynineteen in the database, so get_template_directory_uri() will return its URL. Re-activating the theme will ensure that this … Read more

What’s a good way to allow overwriting files within a child theme if I want the same folder structure?

Because you’re using Composer, none of the normal methods of providing child theme support apply. For a theme that doesn’t use composer, you can allow a child theme to replace a file by including it using the get_theme_file_path() function. So in functions.php, instead of: require_once ‘Core\Utilities\Gallery.php’; You would use: require_once get_theme_file_path( ‘Core\Utilities\Gallery.php’ ); get_theme_file_path() will … Read more

Is it possible to have a template that works on multiple categories where the link address contains the specific category?

Why not using a meta field ? That way you can determine which template to use for specific category template. In your loop just get the current category that you are trying to load: if( have_posts() ) { while( have_posts() ) { the_post(); $meta_value = get_post_meta( get_the_ID() , ‘meta-field’, true ); if($meta_value == ‘template1’) { … Read more

Can a link in WordPress contain a query string that is picked up as $_POST

Looking at the pre_get_posts hook, the problem becomes apparent, the $Format variable is being pulled out of thin air: function get_all_terms($query) { if(empty($Format)) $Format=”test 1″; echo $Format; This variable is undefined, you cannot declare a variable in one file then use it in in other places like this. To do that you have to declare … Read more