Get link for feed of specific post type AND taxonomy
Turns out this does work as intended, I just got the taxonomy slug wrong. Oh well, hope this helps someone in the future.
Turns out this does work as intended, I just got the taxonomy slug wrong. Oh well, hope this helps someone in the future.
Multiselect value in wp_query
You don’t set sort_column to menu_order when you call get_pages, so it defaults to sorting on post_title. $pages = get_pages( array( ‘sort_column’ => ‘menu_order’ ) );
You have multiple options. A) Use inline-CSS: <button style=”background: <?php echo CHOSEN_COLOR_HERE (possibly validated) ?>;”> … </button> B) Write (ID-specific) CSS styles into your page. In your shortcode function, echo a <style> tag, for instance like so: <style> #shortcode-button-1 { background: <?php echo CHOSEN_COLOR_HERE (possibly validated) ?>; } #shortcode-button-2 { background: <?php echo CHOSEN_COLOR_HERE (possibly … Read more
This is the right hook to do this: add_action(‘before_delete_post’, ‘delete_post_attachments’); function delete_post_attachments($post_id){ global $wpdb; global $post_type; if (!$post_type == ‘bkroadkill’) return; $args = array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘any’, ‘posts_per_page’ => -1, ‘post_parent’ => $post_id ); $attachments = new WP_Query($args); $attachment_ids = array(); if($attachments->have_posts()) : while($attachments->have_posts()) : $attachments->the_post(); $attachment_ids[] = get_the_id(); endwhile; endif; wp_reset_postdata(); … Read more
A ‘better’ way of storing variables for global use is to use add_option() to cache variables and get_option() for retrieving variables. This way everything stored in the database and you can access it anywhere.
How to create default categories in new installs?
The whole doco thing for Warp is confusing. You are supposed to use one of the styles configured under the theme, and you’ll find those in a folder such as: /wp-content/themes/yoo_avenue_wp/styles/red Add your /layouts folder under here, then copy in any file you want to override from the folder: /wp-content/themes/yoo_avenue_wp/warp/systems/wordpress/layouts These are then the files … Read more
404 for some custom taxonomy not ALL taxonomy
I can think of a couple of options: Create a new shortcode, e.g. my_gallery. You can copy the code in wp-includes/media.php. Look for the code staring with add_shortcode(‘gallery’, ‘gallery_shortcode’); and then the actual function. Rename / modify as needed. The actual img link is within the $link variable Use something like this (untested), which should … Read more