Tag Info

New answers tagged

1

Yes, the 404 is because the local and remote server URLs are different. As a solution: You should set the local domain to be the same as the remote server In wp-config.php connect to the remote DB When you will need to access the remote server you'll need to update the file hosts and comment out the line with your remote url If your hosts file is updated ...


4

I had the exact same issue. The problem is not one that can be fixed without modifying some code that you probably shouldn't (or perhaps writing a filter or a 'drop-in'). The issue is the CAST directive in the SQL statement. It CASTS the entire table before it does anything, with the amount of records you have, its going to take a while. Capture the query, ...


1

You can use posts_groupby filter: add_filter( 'posts_groupby', function( $groupby ) { return ''; } ); If you want to apply to remove the GROUP BY only to main query and in the frontend, you could do something like this: add_filter( 'posts_groupby', function( $groupby ) { if( ! is_admin() && is_main_query() ) { ...


-1

for showing pages you can use select * from wp_posts where post_type='page' and post_status='publish'


1

There are many wordpress plugins which are not written correctly. Or some plugins are written for old version of wordpress. Please test your plugins. One of them might be causing the problem. Please refer the steps indicated by @karthik for detailed testing.


0

Had a similar issue to you. Your problem is the ad_trigger field is a TEXT field. You need to make this a VARCHAR to allow for indexing. TEXT types are not stored in the table. Instead a pointer is stored in the table and the data is stored elsewhere. While you can create an index for them, I think this process would be too complicated for use with ...


1

It looks like problem is coming from any of installed plug in or your theme. Backup your database. Switch to default wordpress theme. If problem disappears, your theme is the culprit. If problem still exists, Deactivate all installed plugins. If problem disappears, activate plugins one by one and see which plugin causes the error. If problem still exists, ...


0

Wpdb can solve the custom table problems. But tag.charity_id has to be foreign key of the charity.ID


2

You have the following methods of the $wpdb object: $wpdb->flush() that contains a call to mysqli_free_result() or mysql_free_result() if not supported. $wpdb->check_connection() that contains a call to mysqli_ping() or mysql_ping() if not supported. You can of course use all your PHP functions in WordPress. Here's an example based on the \wpdb ...


0

Check the codex - wpdb::prepare expects the first argument to be a sprintf syntax string, followed by the arguments to be injected (again, just like sprintf): echo $wpdb->prepare( '%s', $fetch_row );


0

It has happened to me a couple of times. This is what helped me. if you are uploading the .sql file which is compressed, try to import uncompressed .sql file. Try to export the .sql database again, this error also comes when the database wasn't exported properly.


2

You should be fine deleting empty custom fields. The main reason is, that get_post_meta( $id, 'metakey', true ) returns an empty string if the field is not set, so it is the same as having an empty record set. get_post_meta( $id, 'metakey', false ), returns an empty array if no value is set, so you should be fine too. The only problem you could face is ...


0

Actually, you don't have to use a SQL query just some adjustments in wp_config and functions.php file in your theme. Check out this topic in Wordpress Codex: https://codex.wordpress.org/Changing_The_Site_URL


0

Use PHP and the WordPress API. Place the following in copy-options.php and FTP it to wp-content/plugins, then activate it from the main site: <?php /** * Plugin Name: Copy Options * Plugin URI: http://wordpress.stackexchange.com/q/186092/1685 * Description: Copy options from site 2 to site 1. * Version: 0.1 * Author: TheDeadMedic * ...



Top 50 recent answers are included