Need to return all tags – including empty ones – in list
Try: $args = array( ‘hide_empty’ => false ); $tags = get_tags( $args ); More info re possible args. For csv export, you probably want to use get_the_tags
Try: $args = array( ‘hide_empty’ => false ); $tags = get_tags( $args ); More info re possible args. For csv export, you probably want to use get_the_tags
while ( $loop->have_posts() ) : $loop->the_post(); //Edit Width post type $categories = get_the_terms(get_the_ID(), ‘services’); $separator=”, “; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { echo ‘<a class=”cat_item” href=”‘ . esc_url( get_category_link( $category->term_id ) ) . ‘” alt=”‘ . esc_attr( sprintf( __( ‘%s’, ‘your-themes’ ), $category->name ) ) . ‘”>’ … Read more
You are overwriting $product_cat_slugs on every iteration of your loop – so when it’s finished, that variable will be set to the last value. Why not do all of your outputs inside that loop? Or if for some reason you don’t want to do that, make $product_cat_slugs an array instead of a variable: $product_cat_slugs = … Read more
Generally parent child relationships are done with the page type. See the right side of the image I attached where is says “Parent”. In a single post type, you could also use parent child categories I would think. Possibly with two post types you could use one taxonomy, also with parent child categories. Not recommended … Read more
From several version of WordPress, it’s better to use https://developer.wordpress.org/reference/functions/apply_shortcodes/ io do_shortcode. That said you can surely do something using has_shortcode() https://developer.wordpress.org/reference/functions/has_shortcode/
Since I do not have access to the plugin to confirm I’ll use generic info and updated my answer since I was using the demo they had in their docs. This works in the functions file or on the frontend. // check for plugin using plugin name if(in_array(‘plugin-directory/plugin-file.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))){ //whatever you need goes here. … Read more
Okay so I have resolved this by combining several different wordpress functionalities: Catches the template include conditionally add_filter( ‘template_include’, ‘…’ );, in my case based on a regex match of the expected URI pattern locate_template(‘example-template.php’) to then resolve my (essentially) static template A query within my example-template.php that externally retrieves the resource This must handle … Read more
not tested but maybe you could simply use sleep using wpcf7_before_send_email something like this: add_action(“wpcf7_before_send_mail”, “wpcf7_pause_send”); function wpcf7_pause_send($cf7) { sleep(3600); }
json_encode takes an array/object and turns it into a JSON string. json_decode takes a JSON string and turns it into a PHP array/object/etc With this in mind, we can see some critical mistakes are made in the code, caused by muddling up the two. You’re taking a string of JSON and JSON encoding it, aka … Read more