How get Themes list via REST api?

You can write your own endpoint and use wp_get_themes to get a list of themes via that. Here is a simple one: add_action( ‘rest_api_init’, function () { //Path to rest endpoint register_rest_route( ‘theme_API/v1’, ‘/get_theme_list/’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘theme_list_function’ ) ); }); // Our function to get the themes function theme_list_function(){ // Get … Read more

Weird post pagination url redirect

That’s actually the default behavior when the post does not have any page breaks (i.e. the <!–nextpage–> tag). More specifically, in redirect_canonical(), WordPress only performs a redirect if the post has the page break tag — and that the page number is invalid (e.g. requesting for page #3 when there are only 2 pages). Otherwise … Read more

Can I apply a WP theme to a specific custom page template?

In fact there is, using template_redirect, which you would put in the functions.php file – Here’s what I use: function uniquename_default_template() { if(get_post_type() == ‘posttype’) : /* You could use is_single() instead of get_post_type() == ” or any type of conditional tag) */ include(TEMPLATEDIR . ‘path/to/theme/file.php’); /* You could use TEMPLATEDIR to get a file … Read more

Child-theme breaks site

Your parent theme is probably broken. I guess it is using code like this: require_once get_stylesheet_directory() . ‘/admin/options-framework.php’; So it will search in the child theme for files that are present in the parent theme only. It should use get_template_directory() instead.

Changing the title of post with code

Your question isn’t terribly clear, because, yes it is possible to change post data programmatically, and you’re on the right track using wp_update_post, but I’m unsure of what the code in your theme’s index.php file is trying to achieve. My assumption is that you want to be able to change the post title from your … Read more

I want to run different WordPress websites under the same database

I believe a multisite solution + WooCommerce plugin (which is multisite compatible) would answer to the specifications you have listed. About the multisite installation I strongly recommend you to read: https://codex.wordpress.org/Before_You_Create_A_Network https://premium.wpmudev.org/blog/how-to-build-a-wordpress-multisite-network-with-multiple-domains/ As explained in the tutorial above, you can set different domain names for each of your sites, it just requires an additionnal plugin … Read more