Tag Info

New answers tagged

0

I just had the same problem, and solved it using the Participants Database plugin. The pdb_list shortcode supports filters, e.g. [pdb_list filter='state=NY']. You can generate any shortcodes from a PHP script by running a script with the do_shortcode() function, like this: echo do_shortcode('[pdb_list filter='state=NY']'); Now you have all the building ...


0

Well, that just won't work for so many reasons if this is actually your whole plugin. I'm guessing you are getting a fatal error here. This is because you are using HTML (and javascript for that matter) in the PHP document. Also, if the getuser.php is not located at the root of your site, JavaScript won't find it. I would also use the jQuery method, as ...


0

One thing to take into account, NAME is a reserved wordpress word, if you use a field called name, when you submit your form, you will obtain a 404 not found error.


0

You will get the nav_menu_items from wp_term_relationship in correct order. if you want to confirm there order by knowing there order number... u will get the object id of each item from the previous table and search for that id in wp_posts. then there will be column for that particular row named menu_order. so that u can get the actual order number.


2

While I am a big fan of tweaking wordpress as much as it could because it allows us to, I think the best way forward is to have the best algorithm before coding. Reading your question, I came across " Actually, I have created two custom post type named 'truck' and 'drivers' ". Issue: Linking two post types requires extra work as you are doing because ...


0

I think this issue is handled by WooCommerce in their plugin. It also creates its own tables and this is how they take care of Collation part. (I am referring to file class-wc-install.php of WooCommerce). They have written following code in the create_tables function global $wpdb; $collate = ''; if ( $wpdb->has_cap( 'collation' ) ) { if ( ! ...


0

You forgot to declare global $post //Create Meta box function astest_add_metabox() { add_meta_box("astestimonial_metaboxes", "AS-Testimonial Client Information", "astestimonial_meta_box", "astestimonial", "side", "low"); } add_action('add_meta_boxes','astest_add_metabox'); //html code function astestimonial_meta_box() { global $post; ...


0

In answer to your question, yes you should have no problem importing a DB you just exported. Especially if you used the default settings (usually a "quick" export in some versions of PHPMyAdmin). If you modified export settings, that might be the place to look for tracking down your problem.


0

I would suggest you try setting up a localhost by installing either xamp or wamp on your local machine and the setup wordpress on it. Then try to import the sql file on your localhost's phpmyadmin. XAMPP Download WAMP Download Wordpress Download Also you should look out for some tutorials on how to install either one of them if you are finding it ...


0

Dropbox is not a MySQL server so the answer to your original question is no. The best way to do this is simply adjust wp-config on both sites to point to a single MySQL DB. If you are developing locally, you can still have your DB hosted on the WWW and share it with multiple local WP installations.


1

First, you need to to find out what your current version of MYSQL... WordPress requires MySQL 5.0 or greater Since its a VPS, I'm assuming its a linux installation. Just type mysql -V on the command line and it will return your MYSQL version. If the version is compatible with wordpress, this message may be a "plugin/theme related" message. Look at your ...


1

This is an answer I re-porpoised from a question that was abandoned. I thought this will help you solve this issue By default, all custom post types are excluded from the main query, that is why you don't see any posts when going to the front end author page. To accomplish this, you will need to modify the main query to include these post type/s. For this ...


1

If you plan to use it just for your own code, and have it running alongside WordPress' default database driver (wpdb), I see no real problems. It's only if you plan on fully integrating/overriding WP's driver that I see it being near-impossible; hard-coded SQL is prolific throughout core, and translating them to ActiveRecord method calls would defeat any ...


5

I am not going to give any specific code but I will give you Idea how it can be done without creating any custom database table. I am assuming one driver per truck Algorithm Create two html list, make them sortable. Each list items represents a post type and have ID data field. Once sorting is done get all ids in order. Make two array one contains truck ...


0

Custom field data saved in the wp_postmeta table. Best way to access custom field is using wordpress built-in functions. for example: <?php $mykey_values = get_post_custom_values('my_key'); foreach ( $mykey_values as $key => $value ) { echo "$key => $value ('my_key')<br />"; } ?> 0 => First value ('my_key') 1 => Second value ...


1

Your code looks good though. But Try the following approach - $current_date = $_POST['current_date']; $current_date = date( 'Y-m-d', strtotime($current_date) ); $post_id = (int) $_POST['post_id']; $query = $wpdb->prepare( "SELECT start_date FROM {$wpdb->prefix}booking_history WHERE start_date=%s AND post_id=%d", $current_date, $post_id ); /* ...


0

If for "all the conversations a user is in" you mean "all the conversations where a user has commented" you dont need any additional table, just a SQL to get all the posts of conversation CPT where an user commented. Here a function that should do the trick: /** * Get posts (of a given CPT) an user has commented * * @param int|object|void $user User id ...


1

query - you will get sql as argument of the callback. add_filter('query', 'some_callback_that_change_query'); function some_callback_that_change_query($sql){ remove_filter('query', 'some_callback_that_change_query'); // your banny wrote add_filter('query', 'some_callback_that_change_query'); return $sql; }



Top 50 recent answers are included