Tag Info

New answers tagged

0

A while ago I added a function to one of my sites to change a set of posts from one type to another. I can't remember exactly why, but I've dug it out and updated it a little, and it is tested and working. The function Place this in functions.php so that it can be called from anywhere within your blog. /** * Change the type of a WP_Post object * * ...


0

An alternative solution is to use WP REST API: http://wp-api.org/ If your custom post type uses custom fields, the RESP API saves you the trouble of including the custom fields in the RSS.


1

Well to say that these custom fields are insecure in the wp core tables is to say that the usernames and passwords are also insecure, along with any private or password protected posts. As long as you are not outputting these custom fields anywhere but a secure page for logged in, paid up users, no one could retrieve them without server side access to run a ...


0

This soluton will create a metabox on your Edit Post screen and show you four additional form fields - Name Position Publications Freetext It will then save the data in to a corrisponding DB table, with each field in it's own column as you specified. As you have not provided a table name I have guessed at wp_additional_post_info, but you can change that ...


0

It doesn't seem to be a WP Network main object for getting data from other sites in the Network i.e. $wp_network->site1->get_post_type('events'). I solved this using the automatically generated RSS feed for the custom post type. The feed is available on /[custom post slug]/feed How to read the data from other WP sites WP comes with SimplePie for easy RSS ...


0

Welcome to Wordpress development! There's a few things to answer about your question, the first is regarding the hanging on a blank page. Usually that means there is an error of some sort; one of the most helpful things you'll find during development is turning on Wordpress' DEBUG mode, which will instruct PHP to print out errors when anything goes wrong. ...


0

Domain change This kind of error may be caused by wrong host name in image urls that are stored in the database. It is necessary to replace strings holding your old domain with new one: http://olddomain.com --> http://newdomain.com In every migtration process I use the following recommended tool: ...


-1

As far as I know what you wanted to do can be easily achieved using Caspio. You don't even have to use any database. They provide a online database on top of which you can create all sorts of database-driven functioinalites. Here's a video I saw from them that shows how to build and embed a searchable contacts database on a WP site in just a few mins without ...


0

A bit late to answer this, but since its coming up for relevant search, this will be of use to somebody : Wordpress uses EAV database schema for part of its database implementation. Along with the directly accessible post related details in wp_posts, numerous meta is posted to wp_postmeta table for each post. Tags and whatnot. Problem with that is, if ...


1

The following code will properly store data in wp_fafa: $wpdb->insert( $wpdb->prefix . 'fafa', array( 'title' => trim($row->item(0)->nodeValue), 'liveprice' => trim($row->item(2)->nodeValue), 'changing' => trim($row->item(4)->nodeValue), 'lowest' => ...


1

Make sure you have declared the $wpdb variable global $wpdb;. Also calling $wpdb->query() will execute the query for you, so no need to do it again. I would also recommend using $wpdb->insert() as this escapes your data for you: global $wpdb; $wpdb->insert( $wpdb->prefix . 'fafa', array( 'titile' => trim( ...


0

If memory serves, the problem is because you are doing a very large query and then running multiple checks across all of them with your max statement. You might have much better luck breaking it out into two queries so that you can keep the iterative processing to a minimum. For example, you might: Query the posts that have your wanted author Query the ...


-1

Take a look at WP Stagecoach: https://wpstagecoach.com It is designed to deal with exactly this situation. It allows you to make a staging copy of your site with one click, and import changes from staging to live with one click. If you have made changes on both your live site and your staging site, WP Stagecoach will merge your changes. More information ...


0

If you know something about databases, and have access to the back end SQL database (most likely through Cpanel/phpMyAdmin, you can see the structure of the database, including the columns (fields) and their attributes. Knowing this, you can export an Access query into an Excel file with the same fields and attributes as the BuddyPress SQL table, save the ...


0

You said your form is in the main folder? I guess you need to set proper URL for action="". You could try: action="<?php echo site_url() . '/setLiquorType.php'; ?>" It is best practice to put your form code into functions.php and then leave form action="" empty. Then you can trigger your form function when form is submitted. Your Form hrml: ...


0

You should without a doubt use the WordPress XML RPC. No need for direct database connections and crafting manual queries that might break on future updates. Not to mention any plugins/themes you use on your WordPress site that depend on       database-related actions/filters will function as normal. This is the whole reason why an API like ...


1

What you likely need is the function wp_insert_post(). In your backend (not the WordPress backend, just so we're clear), you'll need to do a minimal load of WordPress to allow wp_insert_post() to work. You can do this by define( 'SHORTINT', true ). Some additional reading on doing a minimal load of WordPress: Load minimum WordPress environment Ajax ...


1

There're few plugins to storage it on WordPress database. I recommend you save as users. I believe one of these plugins will help you: https://wordpress.org/plugins/wp-all-import/ https://wordpress.org/plugins/wp-ultimate-csv-importer/ To send emails, you might use an Email Marketing provider, like Mailchimp. In this case you can import all the users to ...


0

As Milo noted, you need to call the importposts functions to have it do anything. Additionally, if your post is not inserted, post_id should hold a wp_error object, so you could see what is wrong by doing the following right before add_post_meta if ( is_wp_error( $post_id ) ) { echo "<p>Bad Post Attempt:</p><pre>" . print_r($post_id, ...


1

Since there are going to be more than one post (lesson) per user, your code would be more like this: <?php if ( is_user_logged_in() ) { $user_ID = get_current_user_id(); $post_ID = get_the_ID(); $viewed = get_user_meta( $user_ID, 'viewed_lesson_tracking', true); if(empty($viewed)){ $viewed = array(); } $viewed[] = $post_ID ...


0

Just set a random user in your wp-config.php for each request: $db_users = array( 'user_1', 'user_2', 'user_3', ); define( 'DB_USER', $db_users[ array_rand( $db_users ) ] );



Top 50 recent answers are included