Using ACF custom field for custom post type to order categories
There’s no need to “pass” the order to your third foreach – just loop over $issue_archive again instead of $terms.
There’s no need to “pass” the order to your third foreach – just loop over $issue_archive again instead of $terms.
Relationship fields can either return an Objects or a Post IDs. That’s up to you (you can choose it when creating the field). Either way that object or ID would be returned inside an array, because the field gives you the option to select multiple values. So in your loop: $members = get_field(‘committee_members’); // assuming … Read more
You can use the following function and filter hook function filter_woo_cart_quantity($output, $cart_item, $cart_item_key){ return ‘<span class=”quantity”>’ . sprintf( ‘%s × Quote’, $cart_item[‘quantity’] ) . ‘</span>’; } add_filter(‘woocommerce_widget_cart_item_quantity’,’filter_woo_cart_quantity’,10, 3);
I will explain it to you without code at the moment, but in things need to be done: Before you render your category html, check its position (depth) from its current category upwards to the parent category. If the level is 2, then add the style you want to post_class (post_class($array)), otherwise do not add. … Read more
Put the add_filter() call in the init function: public function init(){ parent::init(); add_filter(“gform_submit_button”, array($this, “form_submit_button”), 10, 2); add_filter(“gform_confirmation”, array( $this, ‘custom_confirmation’ ), 10, 4 ); } And then add your custom_confirmation() function as a method to the class: class GFSimpleAddOn extends GFAddOn { /* all the other properties and methods */ public function custom_confirmation($confirmation, $form, … Read more
It’s difficult to answer this, but here are some suggestions: Make sure your feeds are valid, e.g. here. In the case of is_wp_error( $rss ) giving true, you can check the corresponding error message with $rss->get_error_message(). Develop with WP_DEBUG activated. Don’t use mysql_query(), it’s deprecated since PHP 5.5. Use the $wpdb object to fetch data … Read more
After much more work, I developed a solution that outputs archives by year, month and day while minimising database calls. Posting it here for others to use: //* Add custom archives below entry content add_action( ‘genesis_entry_content’, ‘custom_archives_page_content’ ); function custom_archives_page_content() { global $post; // set post arguments $args = array( ‘posts_per_page’ => -1, ‘orderby’ => … Read more
You’re going to have to choose between having the file served directly from S3 or having it pop up with a download box for the user. If you serve the file directly from S3, then the user’s browser will determine what to do with it. In the case of images, that will most likely be … Read more
You aren’t ending your while before doing your else: $args = array( ‘post_type’ => ‘members_features’, ‘posts_per_page’ => 6 ); $the_query = new WP_Query( $args ); ?> <? if ( $the_query->have_posts() ) : ?> <? while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><? the_title(); ?></h2> <div class=”entry-content”> <? the_content(); ?> </div> <? wp_reset_postdata(); ?> <?php /** … Read more
I’m not sure what byt_render_link_button() does, but I try this. <?php byt_render_field(“description clearfix”, “”, “”, $accommodation_description_html, ”, false, true); if (!empty($current_url) && $current_url == $list_user_accommodations_url) { byt_render_link_button($submit_accommodations_url . ‘?fesid=’ . $accommodation_id, “gradient-button clearfix”, “”, __(‘Edit’, ‘bookyourtravel’)); } else { byt_render_link_button( ‘http://www.mywebsite.com’, “gradient-button clearfix”, “”, __(‘Book now’, ‘bookyourtravel’) ); }