My custom sql query for getting a username giving me a warning and an error

The Warning Missing argument 2 for wpdb::prepare(), called in /home/…./public_html/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(72) : eval()’d code on line 22 and defined It looks like there’s been a fundamental misunderstanding of what the prepare method is supposed to do. You’ve provided a single parameter to the function, but it expects multiple. Hence the missing argument 2 warning. What Does … Read more

how to display a specific wordpress menu?

Register your navigation menu Add this code to your functions.php file. function my_custom_new_menu() { register_nav_menu(‘my-custom-menu’,__( ‘My Custom Menu’ )); } add_action( ‘init’, ‘my_custom_new_menu’ ); Create new menu You can now go to Appearance » Menus page in your WordPress admin and try to create or edit a new menu. You will see ‘My Custom Menu’ … Read more

How To Load an HTML File As A WordPress Page (With No 301/No Redirect)

You can use the template_include hook to accomplish this. Add this to your active theme’s functions.php file (or create a plugin). add_filter( ‘template_include’, ‘wpse376643_load_html_page’ ); function wpse376643_load_html_page( $template ) { if ( is_page( ‘the-page’ ) ) { // You’ll have to use the server path to your index.html file. $template=”/path/to/your/content/oct2020/index.html”; } return $template; }

orderby in query_posts

take a look here: http://codex.wordpress.org/Function_Reference/query_posts you need to change orderby=meta_value to orderby=meta_value_num -> than you value gets treated as an integer not a string! query_posts(‘meta_key=wpfp_favorites&orderby=meta_value_num’); i would pass an array instead of a string like query_posts( array( ‘meta_key’=>’wpfp_favorites’, ‘orderby’=>’meta_value_num’ ); you dont have to but its easier to read and WordPress converts that string to … Read more