how to redirect to my template

Actually you can overwrite get_page_template() using page_template filter. So now, your code should be like bellow code. add_filter( ‘page_template’, ‘load_template_from_plugin’ ); function load_template_from_plugin( $page_template ){ if ( is_page( ‘bog_test’ ) ) { $page_template = dirname( __FILE__ ) . ‘/bog_test.php’; } return $page_template; } Try the above code then let me know the result. Thanks

Dynamic HTML not displaying at respective place

You’re getting the output there because dynamic_sidebar() displays/echoes the output (widgets in the specific sidebar), so the output is echoed right when the shortcode function is called, which is before the $data is actually echoed. And you can fix that using output buffering: Either append the output to $data: $data.='</div>’; $data.='<div class=”col-xl-4 col-lg-4 col-md-4 col-sm-12 … Read more

What does do_action() function do in wordpress? [duplicate]

Check out the WordPress Codex Krishan: do_action I quote from that codex page Execute functions hooked on a specific action hook. This function invokes all functions attached to action hook $tag. It is possible to create new action hooks by simply calling this function, specifying the name of the new hook using the $tag parameter. … Read more

How to set all external links to a certain domain to “nofollow”?

Assuming you are targetting links in post content, I’d say something like that : add_filter( ‘the_content’, ‘wpse_254317_nofollow’ ); /** * Add rel nofollow according to a predefined domain * to links in content * @param $content * @link http://stackoverflow.com/a/4809181/1930236 * @return mixed */ function wpse_254317_nofollow( $content ) { $my_folder = “https://google.com”; preg_match_all( ‘~<a.*>~isU’, $content, $matches … Read more

Seriously stuck with some custom meta box/plugin stuff

Here is a simple example that adds a meta box to all public post types: // All public post types $post_types = array_merge( array(‘page’ => ‘page’, ‘post’ => ‘post’), get_post_types(array(‘_builtin’ => FALSE)), ); // Add meta box for each post type foreach ($post_types as $post_type) { add_meta_box(‘id’, ‘title’, ‘callback’, $post_type); } WP Codex: get_post_types(), add_meta_box().

Make the css of the widget overwrite theme css

Is possible to make bootstrap css “contextualized” inside a selector, i.e. bootstrap styles works inside that selector, and thanks to css specificity rules, there them take precence over other rules. How to do: First of all download bootstrap less. Let’s assume that this files are in ‘bootstrap/less’ folder. Now create a new less file, let’s … Read more