Ejemplo n.º 1
0
    function tfuse_get_menus_listing2($post_id, $currency_symbol, $symbol_position)
    {
        $title = get_the_title($post_id);
        $price = tfuse_page_options('price', '', $post_id);
        $separator = ".";
        $price_array = explode($separator, $price);
        $single_menu = tfuse_options('single_menu', false);
        ?>
        <li class="drinks_without_image">
            <div class="dishes-content">
                <h2 class="dishes-content-title">
                    <?php 
        if ($single_menu) {
            ?>
                        <a href="<?php 
            echo get_permalink($post_id);
            ?>
"><?php 
            echo $title;
            ?>
</a>
                    <?php 
        } else {
            echo $title;
        }
        ?>
                    <div class="menu_excerpt"><p><?php 
        echo tfuse_get_post_excerpt($post_id);
        ?>
</p></div>
                </h2>
                <?php 
        if ($symbol_position == 'left') {
            ?>
                    <span class="price"><?php 
            echo $currency_symbol;
            echo $price_array[0];
            ?>
<sup><?php 
            if (isset($price_array[1])) {
                echo $separator . $price_array[1];
            }
            ?>
</sup></span>
                <?php 
        } else {
            ?>
                    <span class="price"><?php 
            echo $price_array[0];
            ?>
<sup><?php 
            if (isset($price_array[1])) {
                echo $separator . $price_array[1];
            }
            ?>
</sup><?php 
            echo $currency_symbol;
            ?>
</span>
                <?php 
        }
        ?>
            </div>
        </li>
    <?php 
    }
Ejemplo n.º 2
0
/**
 * Special Events
 *
 * To override this shortcode in a child theme, copy this file to your child theme's
 * theme_config/extensions/shortcodes/shortcodes/ folder.
 *
 */
function tfuse_special_events($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'before_title' => '', 'number' => 3, 'link' => '#', 'link_text' => ''), $atts));
    $out = '';
    $args = array('post_type' => 'event', 'meta_key' => 'special_event', 'order' => 'Desc', 'posts_per_page' => $number, 'meta_query' => array(array('key' => 'special_event', 'value' => 'true', 'compare' => '=')));
    $posts = get_posts($args);
    $out .= '<section class="special-offer">
        <div class="row">
            <div class="special-offer-title">';
    if ($before_title != '') {
        $out .= '<h3 class="section-title-before">' . $before_title . '</h3>';
    }
    if ($title != '') {
        $out .= '<h1 class="section-title">' . $title . '</h1>';
    }
    $out .= '</div>
            <div class="divider"></div>
            <div class="container">
                <div class="row">
                <div class="col-md-8 postlist">';
    foreach ($posts as $post) {
        $permalink = get_permalink($post->ID);
        $out .= '<div class="post clearfix">
                        <div class="inner">';
        if (has_post_thumbnail($post->ID)) {
            $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '', false, '');
            $image = new TF_GET_IMAGE();
            $img = $image->width(200)->height(200)->src($src[0])->get_src();
            $out .= '<div class="post-thumbnail"><a href="' . $permalink . '" class="post-find-more"><span><div class="divider up"></div>' . __('Find Out More', 'tfuse') . '<div class="divider down"></div></span></a><img src="' . $img . '"></div>';
        }
        $out .= '<div class="entry-aside">
                                <header class="entry-header">
                                    <h1 class="entry-title"><a href="' . $permalink . '">' . get_the_title($post->ID) . '</a></h1>
                                </header>
                                <div class="entry-meta">
                                    <a href="' . $permalink . '"><span class="tficon-row"></span></a>
                                </div>
                                <div class="clearfix"></div>
                                <div class="entry-content">' . tfuse_get_post_excerpt($post->ID) . '</div>
                            </div>
                        </div>
                    </div>';
    }
    $out .= '</div>';
    $out .= do_shortcode($content);
    $out .= '</div>
            </div>';
    $out .= '<div class="divider"></div>';
    if ($link != '') {
        $out .= '<div class="container">
                    <div class="row">
                        <div class="col-sm-8 clearfix">
                            <a href="' . $link . '" class="btn btn-black-transparent"><span>' . $link_text . '</span></a>
                        </div>
                    </div>
                </div>';
    }
    $out .= '</div>
    </section>';
    return $out;
}