New answers tagged

0

Have you copied and modified the specified lines from your wp-config.php from old site to the new site? The code should look something like this define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', true ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'yourdomain.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( '...


0

This is generally not a good idea. See this WordPress database diagram. You need to consider: posts that have categories or tags (terms), their relationships, term meta, and taxonomies posts that have authors (users) posts that have comments things that are actually posts that you might not realise are posts (eg. almost everything in WordPress is a post - ...


0

Content includes the author user and comments (and probably more). Dumping just part of the DB as a way to export/import doesn't sound like a very robust idea. DBs are relatively small, and there is almost no reason not to export/import the full DB instead of trying to hack things.


1

As discussed in the comments, your database prefix settings are off-kilter. Check the database prefix actually in use in your database, and make sure it's the same as the one in wp-config.php. Also make sure all of your WordPress-related tables have the same prefix. You'll also need to search through your database, particularly in the _options table, as ...


0

I would suggest googling "wordpress ajax tutorials". Here is one that was beneficial to me. https://premium.wpmudev.org/blog/using-ajax-with-wordpress/ The first problem I see is you have not stated what your 'action' variable is. The JavaScript AJAX call specifies what function is targeted in the 'action' attribute. In WP, this is the hook executes your ...


0

You shouldn't need to change anything in the database. If you've set up your child theme correctly, and it appears in the list of installed themes, activating that child theme, should make any updates necessary. The customizations you made back in the day should go in the child functions.php and child style.css. As long as the function names and class names ...


0

To elaborate on my suggestion, here is some working code: // hook in before theme is loaded add_action('plugins_loaded','custom_maybe_switch_themes'); function custom_maybe_switch_themes() { if (!is_user_logged_in()) {return;} if (!current_user_can('manage_options')) {return;} // check for query request eg. ?usertheme=theme-slug if (isset($...


0

You can use subdomains for your dev and QA installs. Such as qa.domain.com and dev.domain.com. When the subdomains are created sub directories are usually created too. You can install an additional wordpress in each subdomains directory. Then create 2 additional databases. Backup the production database and load it to the 2 new databases. Set up your config....


3

If we look at the WP_REST_Controller::get_collection_params() method, we can see the minimum is 1 and the maximum is 100: 'per_page' => array( 'description' => __( 'Maximum number of items to be returned in result set.' ), 'type' => 'integer', 'default' => 10, 'minimum' => 1, '...


0

it is better you write like this: class My_Activator { public static function jal_install() { global $wpdb; global $jal_db_version; $table_name = $wpdb->prefix . 'fnotice'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE $table_name ( id INT NOT NULL ...


0

Most of your question is off topic, I guess, because it involves a question about Google's APIs. You would need three things: Create the possibility to login to your site with a Google account. There are plugins that make this possible, like this one. Import the list of group members from Google. There probably is an API for this, but that is out of the ...


3

You unserialize() it. Be aware that most WordPress functions will automatically unserialize() database content before using it. See, for example, the Used By list for maybe_unserialize(). This is by no mean an exhaustive list, I'm sure. But if you're retrieving data directly from the database -- because there's not a WordPress function to achieve what you ...


0

get_categories function will return an array of objects, each object a category. You can read more about it here: https://developer.wordpress.org/reference/functions/get_categories/ Edit And example, as Tim Malone mentioned in the comment there are examples on that page. But here is a simple one for you, that will display your categories in a list. $...


0

Personally I think keeping your mods in an array is a nice solution, but transferring them shouldn't be too difficult. Just loop through the array like this: $all_mods = get_theme_mod('thefunk_theme_options'); // retrieve array foreach ($all_mods as $key -> $value) { if (!empty($value)) set_theme_mod ($key,$value); // set array element as separate ...


1

Two things, at least: It looks like you need to declare the global $wpdb and you're using $wpdb->insert() incorrectly. The insert() method doesn't take your SQL query but a list of variables. It then create the SQL for you. See here You can execute SQL directly but it's a different process.


2

In a nutshell your needs are completely unsupported by WP API. Taxonomies in WP are a grouping mechanism. Their primary purpose is to query set of objects, belonging to a group (term) or groups. There is no reverse operation to provide a set of objects and inquire which groups (terms) it belongs to. On top of that your logic requires additional hop to meta ...


3

You could encode them as JSON, or as serialized strings (the latter of which you can do using functions already baked in to Wordpress). Both of these options will let you keep the number of database rows down. However, both of these options will also significantly hamper your ability to search the data, or deal with it meaningfully in other ways if you need ...


0

The only way I could find to solve this problem was creating a new instance on DigitalOcean and migrate all the data. It seems to me that once the MySQL was broken it couldn't be fixed anymore.



Top 50 recent answers are included