$wpdb-prepare : Do I have to bind a parameter to the table name?

No, you do not want to swap out the tablename. If you do, the table name will be wrapped in quotes and it will trigger a SQL error. Try: $table = $wpdb->prefix . ‘members’; $qry = $wpdb->prepare(“SELECT * FROM %s”, $table); var_dump($qry); $qry = “SELECT * FROM $table”; var_dump($result); The first string is invalid SQL. … Read more

Tag selector like stackexchange?

you can do that using JQuery autocomplete plugin and once you have included all of the needed JS files just add this code after your new post form $terms = get_terms(“post_tag”); $tags=””; $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $tags .= ‘”‘.$term->name.'”, ‘; } $tags = … Read more

Filtering custom posts with Ajax

As pointed by @mmm, I just needed to change the ‘append()’ for ‘html()’. And the use of ‘-‘ instead of ‘_’ in the ‘action’ part. I asked him to post it as an answer so I could close the question, but I guess he didn’t see. So, my final AJAX code is: $(“#opt_filter”).change(function () { … Read more

WordPress parent select need to be removed

Per comments a way around it is to set the post_type to something that isn’t a hierarchical type in the filter, as the wp_dropdown_pages() function used to populate the select calls get_pages() which just returns without doing anything if the post_type isn’t hierarchical. So using a non-existent post_type works: function limit_parents_wpse_106164( $args ) { $args[‘post_type’] … Read more

How to correctly submit a search form and display the result in an independent page

To create your own independent search functionality, follow these steps. 1- You need a form to send the data for you. This is a simple form that can do this for you: <form method=”post” name=”car-select” action=”<?php echo site_url(‘/my-page/’); ?>”> <select name=”make”> <option value=”benz”>Benz</option> <option value=”bmw”>BMW</option> <option value=”audi”>Audi</option> </select> <select name=”type”> <option value=”sedan”>Sedan</option> <option value=”coupe”>Coupe</option> </select> … Read more

Assign a Class to the Current “Tag” for Formatting

Add something like this to the functions file: function current_tag($tags) { global $wp_query; $cid = $wp_query->query_vars[‘cat’]; foreach($tags as $tag) { // match tagid to $cid } } add_filter( ‘get_the_tags’, ‘current_tag’); This won’t work by itself, but it will be a good start for getting the right information to the right place.

Contact form 7 select box different value-text than content-text in option [closed]

It looks like this is supported by Contact Form 7 natively, it’s just not very obvious on how to make it happen. Here’s a documentation page explaining the functionality: http://contactform7.com/selectable-recipient-with-pipes/ Basically, all you have to do is put the values like so: “Visible Value|actual-form-value” What comes before the pipe | character will be shown in … Read more

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