Hot answers tagged

3

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action('wp_loaded','maybe_prerun_shortcodes'); function ...


3

This may be a silly idea, but it might work: 1 Let your shortcode explode to an iframe with a custom query_var (tutorial). Like this: <iframe src="http://www.example.com/?p=123&my_query_var=content_only"></iframe> 2 In your single.php detect the query_var and in that case skip visual header, sidebars, footer - anything not connected to ...


2

Load visual compose css function get_visual_composer_style($id) { return '<style>' . get_post_meta( $id, '_wpb_shortcodes_custom_css', true ) . '</style>'; } Load css based on shortcode function custom_shortcode_scripts() { global $post; if( is_a( $post, 'WP_Post' ) && has_shortcode( ...


2

There is no order_by. Change order_by to orderby and it should work. The default value of compare is = so it is unnecessary, you can remove it. Also, you should specify type of the meta_value if it is a specific type rather than the default CHAR.


2

You could filter the include paths returned by get_included_files by removing any files from the list that are not in your theme (and/or child theme) directory: function get_theme_includes() { $includedfiles = get_included_files(); // normalize theme paths for matching $styledir = str_replace("\\","/",get_stylesheet_directory()); ...


2

There is no concept of "containing" the settings of a single plugin in WP. Plugins use core APIs (such as Options) freely to store data. So on WordPress level to do this the whole plugin's code will need to be examined to have a complete catalog of things which need to be moved. Plugins themselves might implement their own export/import functionality. If ...


1

If the links are coming from the main content areas, you could create a hook which acts against this "content" output. In your themes functions.php file, you could try something like: add_filter('the_content', 'the_url_filter_function_name', 30); function the_url_filter_function_name($content) { return str_replace('bad-url.com', 'good-url.com', ...


1

I am not sure I follow your question, title seems different from question itself. You seem to want to get rid of index.php in URL? It's hard to say confidently from outside, but it looks like PATHINFO permalink. If that's the case you would need to change your WP permalink configuration to more common "pretty" one. Doesn't have anything to do with CPT's ...


1

If I get this right each of your posts have one value of Exercise and one Value of Tempo? I would do the following probably: Build a list of exercises. For each exercise query query: 1 posts, ordered by Tempo, descending. This is probably as good as it gets staying within realm of WP API. Might not be practical for high counts of Exercises, it's all ...


1

You first have to build a query for your posts, and inside that query you would get all your custom fields and compare them. You could use a plugin like CMB2 to build repeatble grouped fields so you can get the exercises grouped (all Excercises1, all Excercises2, etc) and also asign each to have a TEMPO field attached to that group. It would be easier then ...



Only top voted, non community-wiki answers of a minimum length are eligible