How to get the parameters on page and avoid 404?

The conjunction of add_rewrite_rule() & add_rewrite_tag() is a little bit tricky, perhaps you could use parse_url hook what came useful for me. The code below is to catch multiple paramete=value separated with slash. Code – add_filter( ‘parse_request’, ‘wpse128790_parse_request’ ); function wpse128790_parse_request( $wp ) { $pageslug = ‘mypage’; if( isset($wp->request) && strpos($wp->request, “https://wordpress.stackexchange.com/”) ) { $requests … Read more

Ger posts from similar tags and categories

Below is the solution for your problem If my understanding is right! if ($tags) { $tag_ids = array(); foreach($tags as $single_tag) $tag_ids[] = $single_tag->term_id; $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’ => array($post->ID), ‘showposts’=> 5, ); if( count($args) < 5 ) { $n = 5 – count($args); //to get posts based on the category if ($categories) { … Read more

Using Iris Colorpicker on TinyMCE shortcodes page [duplicate]

Your problem probably is the following line in your JavaScript file: file : url.replace(‘/js’,”)+’../../tinymce_shortcode.php’ First, this way you’re bringing it out of context. Just load it up front when you init the plugin (and when you’re on a post.php or post-new.php request – see current_screen() return values to narrow that down to the needed requests … Read more

How to change value of $menu_class in ep_nav_menu?

There is no need to add any code for this. You can use the Screen Options on the menu admin end to achieve this. Please check the instructions below. Login to the admin end of your wordpress site and navigate to Appearance => Menus section. Click the down arrow against the menu item you need … Read more

How to load a plugin when doing an Ajax call? [duplicate]

You are not using ajax right. Why are you adding your ajax callback function to the init action? You need to read http://codex.wordpress.org/AJAX_in_Plugins Attach your ajax callback function to wp_ajax_your_defined_action like this: add_action( ‘wp_ajax_your_defined_action’, ‘your_callbck_function’ ); For this to work you have to use wp-admin/admin-ajax.php as your ajax url and you have to post your_defined_action … Read more