Sorting events by descending date, and ascending time if multiple events on a date
Sorting events by descending date, and ascending time if multiple events on a date
Sorting events by descending date, and ascending time if multiple events on a date
WordPress is not creating table in database after activating plugin,
You need to make sure that the $currentcat variable is set before this query runs. This should be the id of the category you want to pull top posts from. $sql = “SELECT count(mr.post_ID) AS totHits, p.ID, p.post_title FROM $wpdb->posts p JOIN {$wpdb->prefix}kf_most_read mr ON mr.post_ID = p.ID JOIN {$wpdb->prefix}term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE … Read more
It might not be very light solution but it might be much more straightforward approach to load WP core and use current_user_can() and related stuff for determining user permissions.
To answer your question… Yes, it’s doable. But to give you some pointers into the right direction… I’ve known some folks who have had good success using the WordPress Importer plugin. You could conceivably export your geo data from your database (using whatever DB management tool you’re comfortable with) to the import format that this … Read more
There are a lot of pieces to this puzzle. You need to be able to convert the postcodes into a numerical data format so you can query the pages/posts with “is greater than [current location minus 5 miles] and less than [current location plus 5 miles”. In two dimensions. This means storing the latitude and … Read more
I normally use mysqldump and sed: on old server: mysqldump -u user -p OldWpdatabase > wpdb.sql sed -i ‘s/oldurl/newurl/g’ wpdb.sql on new server: mysql -u user -p NewWpdatabase < wpdb.sql sed is used to search and replace all the hard coded occurrences of the website if needed.
All of the real work here is being done by $geoDataStore->getPostIDsOfInRange. That is where the search is done and that is what isn’t returning the results you want. WP_Query just pulls the specified post IDs. There is no reason you should have to abandon that part of the code, though you may want to add … Read more
The table isn’t defined on your insert function. So you will need to add – $table_name = $wpdb->prefix . ‘countries’; as you did for the create table function.
First, prepare() allows you to specify two different types of data: %s for String Types %d for Integer/Numeric Types The reason is simple: MySQL only knows two (and a half) data types: Strings and Numerics (and Date/Time). So this way you specify what type it is and make sure only that type gets trough. Still … Read more