How to add an alternative style sheet as a theme option?
You’re trying to execute PHP in a string – you just need: get_template_directory_uri() . “https://wordpress.stackexchange.com/” . get_theme_mod( ‘posts’, ‘style.css’ ),
You’re trying to execute PHP in a string – you just need: get_template_directory_uri() . “https://wordpress.stackexchange.com/” . get_theme_mod( ‘posts’, ‘style.css’ ),
From: https://developer.vimeo.com/player/js-api#universal-event-spec If you’re embedding and controlling multiple players on a page or using our JS API library (Froogaloop), you should give each player a player_id that matches the id of the iframe element. http://player.vimeo.com/video/VIDEO_ID?api=1&player_id=vimeoplayer You may need to add the player_id query parameter to the src definition.
The approach is pretty much sound, this is how these things work in WordPress. You might want to use add_rewrite_enpoint() for implementation though, since it compresses multiple steps into on integrated call and fits many use cases well.
I think you just forgot to run the shortcodes [foo a=”b”] and [bar a=”c”] through the do_shortcode filter: do_shortcode( ‘[foo a=”b”] [bar a=”c”]’ ) The output of the_content() is filtered through the do_shortcode, so you can just add it into your editor instead. Running your code I get the following output for the $arguments dump: … Read more
This will not work due to the “same-origin policy” unless that server you are trying to reach specifically allows these type of requests with something like Access-Control-Allow-Origin: *. You can read the documentation on MDN in order to get more information about this topic. From my tests, the server will also need another header configured … Read more
There is the constant WP_USE_THEMES which when set to false in wp-config.php disables the theme system on the backend, though it does not completely disable the theme subsystem. I think that is a close as you can get. I am not 100% sure of that though.
You are using name in your terms. In default, try to use the existing term id ( in your case, cat ID and tag ID ). If you see https://plugins.trac.wordpress.org/browser/rest-api/trunk/lib/endpoints/class-wp-rest-posts-controller.php#L918 they will handle your term with sanitize them into non-negative integer using absint. I hope this help. Here example code to hook rest_insert_{$this->post_type} to create … Read more
Hopefully someone will extend on my answer…. The critical part of the rest API that is already in core is the registration and routing of endpoints which should look like (taken from http://v2.wp-api.org/extending/adding/) `/** * Grab latest post title by an author! * * @param array $data Options for the function. * @return string|null Post … Read more
Pretty much wp-load.php is the only way to go. I don’t think there is really another way to load the WordPress functions safely… You can account for path variations by recursively including it from any file where you need it though… eg. function file_find_require($file,$folder=null) { if ($folder === null) {$folder = dirname(__FILE__);} $path = $folder.DIRECTORY_SEPARATOR.$file; … Read more
There isn’t really much of a difference for the default controls. Using the Class is needed for using custom built controls. So basically your first example is the short form of the second one only available for core controls. For details have a look at the documentation.