Order WordPress Query by Custom Field While Still Using Tax_query Argument

You can use a meta_query in addition to your tax_query : https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters I have in which if statement you want to use it so I put it in the of the code. $names = array( ‘fields’ => ‘names’ ); $prac_names = get_terms(‘attorney-practice’, $names); $prac_matches = array_shift(preg_grep (‘(‘. $search .’)’, $prac_names)); $off_names = get_terms(‘office-location’, $names); $off_matches … Read more

Trouble migrating custom post types from non-wordpress cms

I was able to come up with a solution according to advice from the comments. Working code: function import_shows() { $olddb = new wpdb(constant(“DB_USER”),constant(“DB_PASSWORD”),”THE_DB”,constant(“DB_HOST”)); $sql = “SELECT * FROM shows”; $rows = $olddb->get_results($sql); foreach($rows as $obj) { error_log($obj->name); } return; }

OR condition not working

The problem is strictly with your query… or to be more precise, with your misunderstanding of your query 😉 You’ve put || in there and you assume it is OR operator, but… depending on configuration of server it can act as OR or… string concatenation 😉 So change it to OR and it should work … Read more

Restore WordPress Backup Locally?

Jon, what kind of backup do you have? Often it is the sql statements that would be needed to recreate the content of the site. You could view them in a text editor to see what’s there. if you search for ‘posts’ for example you would find the insert statements to recreate the pages & … Read more

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