PATH:
home
/
letacommog
/
lavenue
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_recipes( $attributes, $content = null ) { extract(shortcode_atts( array( 'category' => '', 'column' => '3', 'pagination' => '', 'post_count' => '4', 'shortcodeclass' => '', 'shortcodeid' => '', ), $attributes)); wp_enqueue_style( 'wn-deep-recipes', DEEP_ASSETS_URL . 'css/frontend/recipes/recipes.css' ); $post_format = get_post_format(get_the_ID()); ob_start(); // Class & ID $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; $deep_options = deep_options(); echo '<div class="container wn-recipes ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; $column = $column ? $column : ''; // Query $pagination = $pagination ? get_query_var( is_front_page() ? 'page' : 'paged' ) : '1'; $recipes_query = array( 'post_type' => 'recipe', 'posts_per_page' => $post_count, 'paged' => $pagination, ); $query = new WP_Query( $recipes_query ); //$query = new WP_Query($recipes_post); while ($query -> have_posts()) : $query -> the_post(); $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); // id of image $post_id = get_the_ID(); $cats = get_the_terms( $post_id , 'recipe_category' ); $cats_slug_str = ''; $cat_slugs_arr = array(); if( !empty( $thumbnail_url ) ) { // if main class not exist get it if ( !class_exists( 'Wn_Img_Maniuplate' ) ) { require_once DEEP_CORE_DIR . 'helper-classes/class_webnus_manuplate.php'; } $image = new Wn_Img_Maniuplate; // instance from settor class switch ( $column ) { case '3': $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '319' , '517' ); // set required and get result break; case '4': $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '426' , '517' ); // set required and get result break; case '6': $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '852' , '517' ); // set required and get result break; case '12': $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '1276' , '517' ); // set required and get result break; } } if( is_array( $cats ) ) { $recipe_category = array(); foreach( $cats as $cat ){ $recipe_category[] = $cat->slug; } } else { $recipe_category = array(); } if ( $cats && ! is_wp_error( $cats ) ) { foreach ($cats as $cat) { $cat_slugs_arr[] = ' <a href="'. get_term_link($cat, 'recipe_category') .'"> ' . $cat->name . ' </a> '; } $cats_slug_str = implode( ", ", $cat_slugs_arr ); } $category = ( $cats_slug_str ) ? $cats_slug_str:''; $recipe = rwmb_meta( 'deep_recipe' ); $food_name = rwmb_meta( 'deep_recipe_food_name' ); ?> <!-- Single Recipes /Start --> <div class="col-md-<?php echo '' . $column; ?> recipe-one"> <article class="recipes"> <figure class="recipe-one-img"> <img src="<?php echo '' . $thumbnail_url ?>" alt="<?php the_title(); ?>" > <div class="recipe-one-date colorb"> <span class="author"><i class="ti-user"></i></strong><?php the_author_posts_link(); ?></span> <span class="categories"><i class="ti-folder"></i><?php echo '' . $category; ?></span> <span class="date"><i class="ti-calendar"></i><?php echo get_the_date(); ?></span> </div> </figure> <div class="recipe-one-content"> <h3 class="recipe-one-title"><a href="<?php the_permalink(); ?>" class="hcolorf"><?php echo '' . $food_name . ' ' . $recipe ; ?></a></h3> <p class="latest-excerpt"><?php echo deep_excerpt(31); ?></p> </div> </article> </div> <!-- Recipes /End --> <?php endwhile; if ( $pagination != 1 ) : ?> <div class="row"> <div class="col-sm-12"> <?php if( function_exists( 'wp_pagenavi' ) ) wp_pagenavi( array( 'query' => $query ) );?> </div> </div> <?php endif; echo '</div>'; $out = ob_get_contents(); ob_end_clean(); wp_reset_postdata(); return $out; } add_shortcode('recipes', 'deep_recipes'); ?>
[+]
..
[-] deep-gallery.php
[edit]
[-] process-carousel.php
[edit]
[-] sermons.php
[edit]
[-] progressbar.php
[edit]
[-] distance.php
[edit]
[-] slide-up-note.php
[edit]
[-] schedule.php
[edit]
[-] w-title.php
[edit]
[-] pie.php
[edit]
[-] tablepress.php
[edit]
[-] video-play.php
[edit]
[-] service-carousel.php
[edit]
[-] lefttab.php
[edit]
[-] special-offer.php
[edit]
[-] instagram.php
[edit]
[-] vcw.php
[edit]
[-] testimonials.php
[edit]
[-] socials.php
[edit]
[-] category-tab.php
[edit]
[-] tooltip.php
[edit]
[-] reservation.php
[edit]
[-] postslider.php
[edit]
[-] maxcounter.php
[edit]
[-] video-teaser.php
[edit]
[-] subscribe.php
[edit]
[-] prayerwall-form.php
[edit]
[-] toggle-box.php
[edit]
[-] recipes.php
[edit]
[-] roadmap.php
[edit]
[-] review-items.php
[edit]
[-] dropcap.php
[edit]
[-] accordion.php
[edit]
[-] icon-divider.php
[edit]
[-] like-view-share.php
[edit]
[-] teaser-box.php
[edit]
[-] custom-menu.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] callout.php
[edit]
[-] testimonialslider.php
[edit]
[-] magazine.php
[edit]
[-] prayerwall-items.php
[edit]
[-] donate.php
[edit]
[-] acause.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] highlight.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] causes.php
[edit]
[-] columns.php
[edit]
[-] w-svg.php
[edit]
[-] shop-products.php
[edit]
[-] icon.php
[edit]
[-] blog.php
[edit]
[-] heading.php
[edit]
[-] ourteam.php
[edit]
[-] quote.php
[edit]
[-] googlemap.php
[edit]
[-] tab.php
[edit]
[-] services.php
[edit]
[-] pricingtables.php
[edit]
[-] collection.php
[edit]
[-] postfromblog.php
[edit]
[-] webtags.php
[edit]
[-] infobox.php
[edit]
[-] image-carousel.php
[edit]
[-] before-after-image.php
[edit]
[-] list.php
[edit]
[-] iconbox.php
[edit]
[-] alerts.php
[edit]
[-] speakers.php
[edit]
[-] latest-from-blog.php
[edit]
[-] block-quote.php
[edit]
[-] rooms.php
[edit]
[-] asermon.php
[edit]
[-] buttons.php
[edit]
[-] checklist-param.php
[edit]
[-] our-process.php
[edit]
[-] image-hotspot.php
[edit]
[-] countdown.php
[edit]
[-] sermon-category.php
[edit]
[-] ourclients.php
[edit]
[-] login.php
[edit]
[-] food-menu.php
[edit]
[-] pricing-plan.php
[edit]
[-] search.php
[edit]
[-] review-form.php
[edit]
[-] iconfonts-param.php
[edit]
[-] buy-process.php
[edit]
[+]
assets
[-] latest-tweets.php
[edit]