Three level taxonomy dropdown frontend

After spending many hours using google I managed to make 3-level hierarchical taxonomy dropdown with ajax. Here is my code: searchform.php <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js” ></script> <script type=”text/javascript”> $(function(){ $(‘#apskritis’).change(function(){ var $apskritisSlug=$(‘#apskritis’).val(); // call ajax $(“#savivaldybe”).empty(); $(“#miestas_kaimas”).empty(); $.ajax({ url:”/wp-admin/admin-ajax.php”, type:’POST’, data:’action=get_savivaldybes&apskritis_slug=’ + $apskritisSlug, success:function(results) { //alert(results); $(“#savivaldybe”).removeAttr(“disabled”); $(“#savivaldybe”).append(results); } }); } ); $(‘#savivaldybe’).change(function(){ var $savivaldybeSlug=$(‘#savivaldybe’).val(); // … Read more

Our shortcode dropdown box in Tinymce is not working in WordPress 3.9?

I’ve been stuggeling with a similar issue. (button not appearing in mce editor toolbar). This pattern worked for me in WP 3.9 / tinymce 4.0: tinymce.PluginManager.add( ‘thing’ , function( editor ){ editor.addButton(‘thing’, { type: ‘listbox’, text: ‘My listbox’, onselect: function(e) { // do things… }, values: [ {text: ‘Menu item 1’, value: ‘Some text 1’}, … Read more

How WordPress manages nested dropdown?

Actually <option> field doesn’t work with any CSS. So WordPress Developers/Designers did a simple yet nice trick for the nesting layout for <option> fields. Actually in your inspection you missed something there: <select name=”page_id” id=”page_id”> <option value=”1″ class=”level-0″>Level 0</option> <option value=”2″ class=”level-1″>&nbsp;&nbsp;&nbsp;Level 1</option> <option value=”3″ class=”level-1″>&nbsp;&nbsp;&nbsp;Level 1</option> <option value=”4″ class=”level-2″>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level 2</option> <option value=”5″ class=”level-3″>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level 3</option> … Read more

Dropdown filter in custom posts

When using this hook, your function receives two parameters, onde of them is the slug of the current post_type; <?php function my_post_type_filter($post_type) { $post_slug = $post_type; if( $post_slug == ‘the_post_type_slug’) { // Do something } } add_action( ‘restrict_manage_posts’, ‘my_post_type_filter’ ); ?> To learn more about this hook check the Docs.

wp_dropdown_categories and custom taxonomy + custom post type

You can get your code to work the expected way by adding the following three arguments to your $args array which you pass to wp_dropdown_categories(): name — the select name as in <select name=”<here>”>, and you should set it to theme which is your custom taxonomy slug. value_field — the value of the <option>‘s in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)