Josh Robbs
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: add_rewrite_rule speed/performanceThanks! That’s what I’m hoping to do. I’m trying to understand the technical implications of the SEO guy’s wishlist.
Forum: Fixing WordPress
In reply to: add_rewrite_rule speed/performanceIt wouldn’t be simply a regex match. I’d be using conditionals too.
They want the site to be able to process URLs like:
domain.com/tax1
domain.com/tax2
domain.com/cpt1
domain.com/cpt1/tax1
domain.com/tax1/tax2
domain.com/cpt1/tax1/tax2Tax1 and Tax2 are both custom taxonomies.
I’m assuming that I’m going to have to whip up a series of conditional statements based on the slugs before I get to the add_rewrite. And that means more database calls (is_taxonomy and whatnot). I’m afraid that doing that would slow down everything.
Please, correct me if I’m wrong.
I could add triggers if I need to.
Turn `domain.com/tax1′ into ‘domain.com/1/tax1’ so I’d know which rule to use. That could help shrink the process.Forum: Developing with WordPress
In reply to: Using the REST API system for bulk updatesThanks!
Forum: Plugins
In reply to: [WooCommerce] Change the item order of a WooCommerce order in the admin“The order items data structure is complex” Too true! I figured it out when I rebuilt the cart and checkout pages. But that looks like the hook I was looking form
Thanks!
Figured it out although I’m guessing there’s a better way.
EM_Events::get( get_the_ID() )used on an event returns an array with 3 nested objects and the term_id is in an array inside of all that.$eventlistobj = EM_Events::get( get_the_ID() ); //event list $eventobj = $eventlistobj[0]; // single event $eventcategories = $eventobj->categories; //category list $eventcategories_terms = $eventcategories->terms; // list of terms foreach($eventcategories_terms as $eventcategories_term){ $eventcategory = $eventcategories_term->term_id; // single term ID }This works because each event only has 1 category. Should it have multiple, I’m sure this would break.
- This reply was modified 6 years, 3 months ago by Josh Robbs.
- This reply was modified 6 years, 3 months ago by Josh Robbs.
Forum: Developing with WordPress
In reply to: Error with multiple get_the_termsHere’s a little more information and a more specific question.
I’m using this template for 3 taxonomies on 1 CPT:
$vars = get_the_terms( $post->ID , array( ‘tax_slug’) );
foreach ( $vars as $var) {
$output_var = $var->name;
}It works the 1st time – whichever taxonomy I put first.
The 2nd and 3rd iterations don’t work. Here’s a sample var_dump:
object(WP_Error)#3417 (2) { ["errors"]=> array(1) { ["invalid_taxonomy"]=> array(1) { [0]=> string(17) "Invalid taxonomy." } } ["error_data"]=> array(0) { } }To be clear, I’m using this on 3 custom taxonomies. Whichever taxonomy is 1st works – regardless of which taxonomy it is.
- This reply was modified 7 years, 4 months ago by Josh Robbs.
Forum: Developing with WordPress
In reply to: List of category array elementsBingo. Thanks a million!
Forum: Developing with WordPress
In reply to: How do you query by category by name with apostrophe?Tested and verified. Thank you again, Steven.
Forum: Developing with WordPress
In reply to: How do you query by category by name with apostrophe?Thanks, Steven! I was going through all the escape functions and not getting anywhere.
My apologies for not responding. This was a mis-post. I was looking for help with a plugin with a very similar name. Thank you for your help.
Forum: Fixing WordPress
In reply to: Site is “www” but all scripts are notDatabase is clean except for some old references and a couple links (via Search & Replace).
It’s set in General.Also, I’m not seeing this issue on localhost or my public dev server. The only thing they did was add an SSL. Could those rewrites be note rewriting script src for some reason?
Forum: Fixing WordPress
In reply to: Site is “www” but all scripts are notI’ll check the database, but the issue isn’t “http” vs “https”. The issue is “http://domain.com” vs “http://WWW.domain.com”. AFAIK the site has never been “http://domain.com” but that’s the src URL for all scripts.
@badavision
You should be able to deactivate it by renaming the plugin folder or deleting it.Not quite what I was looking for, but it pointed me in the right direction.
Final functional code for retrieving date published of events created via Events Manager:
if ( get_post_type() == 'event' ) { global $post; $this_date = mysql2date( get_option( 'date_format' ), $post->post_date ); $date = " on ". $this_date."."; }Forum: Plugins
In reply to: [Redirection] Redirecting multiple pages to home pageOf course I crack the code once I ask for help.
In case anyone else is looking for this:
(.*)\/locations.* => /$1