Topher
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: What to learn to make a site layout like thisYou could do this with either Gutenberg with some addons like Stackable, or Elementor. Research both Stackable, KadenceWP, and Elementor and see which of them feels like it fits you best. Go with that one.
Also look at the Neve theme.
- This reply was modified 7 hours, 5 minutes ago by Topher.
Forum: Fixing WordPress
In reply to: Unable to add new image to media libraryIt’s possible you’re uploading files that are so big that it takes the server too long to process them. WordPress makes 4 different sized copies of each image you upload.
iOS (on the iPad) often doesn’t give you the full sized original, but rather a downsampled version. I found this with my phone.
Take one of the images that doesn’t work, resize it to something like 2560 wide, and try uploading that. If that works then the server simply doesn’t have the oomph to process the really big ones.
Forum: Fixing WordPress
In reply to: Integrate custom post type with woocommerceWooCommerce creates a products CPT already, you don’t need to make one by hand.
Forum: Fixing WordPress
In reply to: Scheduled Posts Posting ImmediatelyThat’s great sleuthing, well done.
Forum: Developing with WordPress
In reply to: Save all posts automatically and execute functionRock on!
Forum: Networking WordPress
In reply to: Should I use a multisite for my business?Ok, that actually sounds like a great use case for multi-site. It’s certainly one viable option for multi-lingual, and using all the same theme (and probably plugins?) makes it sound quite reasonable.
Forum: Fixing WordPress
In reply to: Scheduled Posts Posting ImmediatelyI’m sorry, but I think I’m tapped out. In order to really figure it out I’d need my hands on the code and spend hours testing. 🙁 I’m not available, but if you know a dev they could probably do that for you.
Forum: Developing with WordPress
In reply to: Save all posts automatically and execute functionThe custom table shouldn’t matter, you can just adjust the query accordingly. If you look stuff up in phpMyAdmin it’ll show you the query it used.
The array I showed has post_ids as keys and dates as values. So you’d do something like
foreach ( $birth_dates_array as $post_id => #term ) { wp_set_post_terms( $post_id, $term, 'WhateverYourTaxonomyIs' ); }
Forum: Fixing WordPress
In reply to: Scheduled Posts Posting ImmediatelyThis ONLY happens when using the new block editor? Can you install the Classic Editor plugin and see if it does it there too? You might be onto a real bug here.
Forum: Developing with WordPress
In reply to: Save all posts automatically and execute functionFirst use a tool like phpMyAdmin to look at the postmeta table and find your custom fields. Is the date stored in plain text like 2022-10-01 or is serialized somehow? Plain text is preferred, but we could work with serialized.
Read about $wpdb: https://developer.wordpress.org/reference/classes/wpdb/
That makes it easy to send a custom query. Something like this:
$birth_dates = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE <code>meta_key</code> = 'YOURKEYNAME'" );
where YOURKEYNAME is whatever you called your birthdate field.
I don’t know for sure what the format will be coming back from that, but to be sure then you can do something like this:
$birth_dates_array = []; foreach ( $birth_dates as $birth_date ) { $birth_dates_array[ $birth_date->post_id ] = $birth_date->meta_value; // it might be this instead: // $birth_dates_array[ $birth_date['post_id'] ] = $birth_date['meta_value']; }
then you’ll have an array that looks like this:
[ 1,'2022-10-01', 2,'1971-07-17' ]
then it’s a plain array. Use
foreach
to loop over it and usewp_set_post_terms
(I misspoke aboutwp_create_term
above) to connect posts to terms.- This reply was modified 3 months, 2 weeks ago by Topher.
Forum: Fixing WordPress
In reply to: Scheduled Posts Posting ImmediatelyCheck this plugin out, it may help: https://wordpress.org/plugins/health-check/
Forum: Fixing WordPress
In reply to: All Categories not showing in Categories widgetMay the wind be ever at your back. Unless it’s hot out, and then a gentle breeze to the face.
Forum: Fixing WordPress
In reply to: All Categories not showing in Categories widgetWoo! I’m a genius and I didn’t even know it! Try this then, go to Settings → Permalinks and simply hit save, no changes. That MIGHT reset all of them at once. Maybe not, but it won’t HURT anything.
Forum: Developing with WordPress
In reply to: Save all posts automatically and execute functionThe taxonomy query is going to be WAY faster than a custom field query with math in it. Plus as a term you can do all sorts of other interesting things like make data maps of age groups, without every hitting the posts table.
Forum: Fixing WordPress
In reply to: All Categories not showing in Categories widgetI can’t see inside your admin area, but that is really odd. As a developer I can’t even think of how that’s possible. Maybe try taking one of those post OUT of that category, save, then put it back in and save again? Maybe only one side knows what category it’s in.