Tag Info

New answers tagged

2

You can use plugins such as BackupBuddy, but I prefer to script this and use wp-cli, which reads wp-config.php and means you don't have to worry about mysql credentials. wp-cli allows you to: export the db: wp db export <filename> import the db: wp db import <filename> safe search and replace (including serialised data): wp search-replace ...


1

WordPress uses a prefix by default just in case the database is being used by more than WordPress. Since creating a new DB is pretty simple I would go that route. You would get the potential benefit of it being something separate that you can easily export, import or blow away if needed and also the potential security benefit if your WP site gets hacked this ...


2

If you're going to keep using that database for other things as well, keep it separate. But from what you're saying, you are rather trying to expand functionality for it within the site, so better integrated. There are a lot of things you can do with a database even from within WP anyway.


1

Use the following functionto set views manually function setPostViewsManually($postID, $viewCount) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); update_post_meta($postID, $count_key, $viewCount); } You can run this code by <?php setPostViewsManually(get_the_ID(), 1234); ?> The above code will ...


0

The actual information - e.g. the 'slug' for the page or post is stored in wp_posts under the post_name column. This is a slugified version of post_title normally, but can be overwritten on a page by page basis. The full permalink is deconstructed based on what settings you have chosen in Settings -> Permalinks, but the actual slug is in post_name in ...


0

Wordpress provide the facility of using the custom user table but there isn't a way to get posts that to only post_type which are product. A good news may be that with custom work almost anything is possible. :) You may even look into using the REST API that's been added as of 2.1. With that you can currently read information from all of your stores. So ...


2

When you work with any type of database it is of UTMOST importance to create regular backups. Once you delete something from a database it is gone forever. This is what they teach in the first class of any database course. Here is a link to a question in DB stackexchange I highly doubt they can do anything about it, but do contact your webhost to see if ...


0

The theme is using custom post type and you are right to worry about using it. If you start using this theme, you are doomed in the sense that you can't change it later without breaking the site. My personal opinion on theme is that it should only work on the visual aspect and leave the functionality part to the plugin. But so many themes break this rule ...


0

The theme is using a custom post type, in this case, "lyrics". Converting the old posts over to it should be as simple as writing a single query to update the old posts to the new post type. The query will be something like: UPDATE `wp_posts` SET post_type = "lyrics" WHERE post_type = "post"; Just as an added precaution, run this one first to ensure that ...


0

I've already faced this kind of matter, but my approach was quite different: I've created a sort of framework to do crud operation and manage totally new entities, each one different from others, using the wp db layer, supported by a custom db layer. In your case, I think is possible to do what you want but you need to use hook to intercept save post call, ...


0

You can change the theme based on the current domain like function select_theme( $current_theme ) { if ( 'domain1.com' === $_SERVER['HTTP_HOST']) { return 'domain1 theme name'; } else { return 'domain2 theme name'; } } add_filter( 'stylesheet', 'select_theme' ); add_filter( 'template', 'select_theme' );


0

You should store additional user data in wp_usermeta table. For that, use add_user_meta() function. Here's an example of how you can store locations $location = array('name' => 'example location name', 'street' => 'example street name', 'note' => 'example user note' ); add_user_meta($user_id, ...


0

I am pretty sure that what you are looking at are post revisions. The posts with status "expired" are the primary post. The ones with "inherit" are revisions or autosave. Look at the post_name column and you should see a pattern like **-autosave-** or **-autosave-**, and then look at the post_parent column and your "expired" post ID should match. The primary ...


0

It's a bit hard to answer with not much information, but here are some things you can try and ask yourself: Reset your permalinks (Settings > Permalinks > Save Changes) What happens when you set WP_DEBUG to true in your wp-config.php file? Is this a custom post type, or was anything recently changed that may have caused this?


0

Don't tag your option as selected if you don't want it selected, which means that you should probably be using selected() to dynamically select any value that has already been set. That should solve the problem. But this could be cleaned up a lot: esc_attr() accepts a single parameter. You are sending it two. It would be easier and cleaner to pull the ...


0

Are you able to export the database and import to a newly created database and then change the db credentials in wp-config.php to connect to.


0

You can easy plugin transfer to other host https://wordpress.org/plugins/wp-clone-by-wp-academy/ localhost 1: first install plugin your localhost wordpress. 2: goto wp clone create local backup. 3: copy backup .zip upload any host/server. host/server 1: first install plugin your host/server wordpress. 2: goto wp clone select restore backup. 3: ...


0

If your client's existing site is a wordpress site and you just want to use your new theme then you can just upload the theme from your local PC to the remote server and change the theme out in the remote backend. Either way, how you run both sites simultaneously will differ depending on your exact setup. As far as transferring your database goes, I assume ...


0

Most important failure of WordPress is their database design. Its only useable for hosehold websites. High-performance sites will never use Anti-pattern as database design due to performance issues like BASIC indexing!


0

You just need to do a RIGHT JOIN to query the rows that have NULL values



Top 50 recent answers are included