Save data of select list after clicking save

You have the add_action that’s supposed to hook your prfx_meta_save function inside the function itself, so it never gets hooked or called. You need to move the add_action outside the function. This will never work: function prfx_meta_save( $post_id ) { add_action( ‘save_post’, ‘prfx_meta_save’ ); } Move it outside the function: function prfx_meta_save( $post_id ) { … Read more

Adding an onchange event to a custom dropdown menu in WordPress

I have added a wrapper to your html output and then written a jQuery code that you can use – function embed_url() { $dropdown_menu = ‘<select><option>OptionDefault</option><option value=”?id=1″>Option1<option value=”?id=2″>Option2</option></select>’; $full_url=”<object type=”text/html” data=” . $embed_this_url . ‘ style=”width:100%; height:100%”><p> URL could not be loaded. </p> </object>’; return ‘<div class=”site-url”>’ . $dropdown_menu . $full_url . ‘</div>’; } jQuery … Read more

Create a drop down list within an active page not nav menu

I’m not sure if you have pages with categories, but I can show you a example using posts instead. Dropdown Filter from posts by category: <?php $url = get_home_url(); $category_slug = ‘my-new-category’; //remember to get the slug $posts_by_category = new WP_Query([ ‘post_type’ => ‘post’, ‘category_name’ => $category_slug, ‘nopaging’ => true ]); if ( $posts_by_category->have_posts() ) … Read more

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