WordPress database issues – menu not saving correctly, media thumbnails not showing
WordPress database issues – menu not saving correctly, media thumbnails not showing
WordPress database issues – menu not saving correctly, media thumbnails not showing
OK, so let’s assume you have these URLs in some array (if you don’t, you can easily prepare it using any developer text editor, I guess). Let’s call that array $slugs and let’s say it’s defined like so: $slugs = array( ‘customer-name’ => ‘google-customer-name’, … ); So there are only slugs in there. So now … Read more
I’m not going to tell you about what will happen. I’ll here give you an example on how you can run that piece of sql without phpMyadmin. Add this to your functions.php for temporary purpose. Not to forget about removing this after one run of your website. $mymeta=”_my_first_meta”; $wpdb->query( $wpdb->prepare(“CREATE INDEX wp_postmeta_my_first_meta ON wp_postmeta (%s)”,$mymeta) … Read more
$result = $wpdb->get_results( “SELECT `account_number`,`consumer_name`,`bill_amount`,`due_date`,`disco_date`,`bill_status` FROM {$wpdb->prefix}_bill_inquiry where `account_number` = ‘$inputnumber’ AND `pin_number` = ‘$inputpin'”, OBJECT ); $wpdb->prefix will automatically print the prefix, then to convert the result in array form you can use the following snippet: $result = json_decode(json_encode($result),true); You can either place it in a template or you can create a shortcode in … Read more
You could try to loop through all the posts and if the content contains the link, call this: change_post_status(get_the_ID(),’private’); or try draft if appropriate. Register this function first: function change_post_status($post_id,$status){ $current_post = get_post( $post_id, ‘ARRAY_A’ ); $current_post[‘post_status’] = $status; wp_update_post($current_post); }
Is there a way for two deferent themes to consume two different DB on a same WP instance?
You can try this. However, I am sure there must be a better alternative.. $past_events = get_posts(array( ‘post_type’ => Tribe__Events__Main::POSTTYPE, ‘paged’ => $paged, ‘posts_per_page’ => ’10’, ‘eventDisplay’=>’past’, ‘orderby’=> ‘title’, ‘order’ => ‘ASC’, ‘s’ => $searchText ?: ”, )); $post_arr = array(); foreach ( $past_events as $past_event ) { $post_arr[ $past_event->post_title ] = $past_event->ID; } $post_arr … Read more
Why does DROP TABLE-ing the `wp_options` reset my user session?
wp links the posts and the terms in table wp_term_relationships so one doesn’t really have to worry about the custom taxonomy. You basically want to change the term ids from that of the default to the term_id of the new term in your custom taxonomy for your select set of posts. Lookup the term_ids and … Read more
turned out to be a problem with an external plugin. Was failing(dying) on the last 2 do_actions() in the function wp_insert_post(). Not sure how to fix that problem yet but this question is solved.