<?php 
                }
                ?>

                                            <h4><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                                            <p><?php 
                framework_excerpt(10);
                ?>
 <a class="more-details" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('More Details ', 'framework');
                ?>
<i class="fa fa-caret-right"></i></a></p>
                                            <span><?php 
                property_price();
                ?>
</span>
                                            <div class="ajax-response"></div>
                                        </article>
                                        <?php 
        function widget($args, $instance)
        {
            extract($args);
            $title = apply_filters('widget_title', $instance['title']);
            if (empty($title)) {
                $title = false;
            }
            $agent = $instance['agent'];
            $sort_by = $instance['sort_by'];
            $count = intval($instance['count']);
            $featured = isset($instance['featured']) ? (bool) $instance['featured'] : false;
            $agent_args = array('post_type' => 'property', 'posts_per_page' => $count, 'meta_query' => array(array('key' => 'REAL_HOMES_agents', 'value' => $agent, 'compare' => '=')));
            // If show only Featured Properties
            if ($featured) {
                $agent_args['meta_query'][] = array('key' => 'REAL_HOMES_featured', 'value' => 1, 'compare' => '=', 'type' => 'NUMERIC');
            }
            //Order by
            if ($sort_by == "random") {
                $agent_args['orderby'] = "rand";
            } else {
                $agent_args['orderby'] = "date";
            }
            $agent_query = new WP_Query($agent_args);
            echo $before_widget;
            if ($title) {
                echo $before_title;
                echo $title;
                echo $after_title;
            }
            if ($agent_query->have_posts()) {
                ?>

                <ul class="featured-properties">
                    <?php 
                while ($agent_query->have_posts()) {
                    $agent_query->the_post();
                    ?>

                        <li>
                            <?php 
                    if (has_post_thumbnail()) {
                        ?>

                                <figure>
                                    <a href="<?php 
                        the_permalink();
                        ?>
">
                                        <?php 
                        the_post_thumbnail('grid-view-image');
                        ?>

                                    </a>
                                </figure>
                            <?php 
                    }
                    ?>

                            <h4><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    the_title();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
                            <p><?php 
                    framework_excerpt(7);
                    ?>
 <a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More', 'framework');
                    ?>
</a></p>
                            <span class="price"><?php 
                    property_price();
                    ?>
</span>
                        </li>
                    <?php 
                }
                ?>

                </ul>
                <?php 
                wp_reset_query();
            } else {
                ?>

                <ul class="featured-properties">
                    <?php 
                echo '<li>';
                _e('No Property Found Under Selected Agent!', 'framework');
                echo '</li>';
                ?>

                </ul>
            <?php 
            }
            echo $after_widget;
        }
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        if (empty($title)) {
            $title = false;
        }
        $number = absint($instance['number']);
        $sort_by = $instance['sort_by'];
        $categories = (array) $instance['categories'];
        echo $before_widget;
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        $args = array('post_type' => 'post');
        //Number
        $args['posts_per_page'] = $number;
        //Categories
        $args['category__in'] = $categories;
        //Order by
        if ($sort_by == "popular") {
            $args['orderby'] = "comment_count";
        } elseif ($sort_by == "random") {
            $args['orderby'] = "rand";
        } else {
            $args['orderby'] = "date";
        }
        $recent_posts_query = new WP_Query($args);
        if ($recent_posts_query->have_posts()) {
            while ($recent_posts_query->have_posts()) {
                $recent_posts_query->the_post();
                ?>
                <div class="sidebar-menu-item clearfix">
                    <h4><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                    <?php 
                if (has_post_thumbnail()) {
                    ?>
                        <figure>
                            <a href="<?php 
                    the_permalink();
                    ?>
">
                                <?php 
                    the_post_thumbnail('small-menu-thumbnail', array('class' => "sidebar-menu-thumb"));
                    ?>
                            </a>
                        </figure>
                        <?php 
                }
                ?>
                    <p>
                        <?php 
                framework_excerpt(10);
                ?>
                    </p>
                    <a class="read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'framework');
                ?>
</a>
                </div>
				<?php 
            }
        }
        echo $after_widget;
    }
                <h5 class="price">
                    <?php 
        property_price();
        $type_terms = get_the_terms($post->ID, "property-type");
        if (!empty($type_terms)) {
            echo '<small> - ';
            foreach ($type_terms as $type_term) {
                echo $type_term->name;
            }
            echo '</small>';
        }
        ?>

                </h5>
                <p><?php 
        framework_excerpt(20);
        ?>
</p>
                <a class="more-details" href="<?php 
        the_permalink();
        ?>
"><?php 
        _e('More Details ', 'framework');
        ?>
<i class="fa fa-caret-right"></i></a>
            </div>

            <div class="property-meta">
                <?php 
        get_template_part('property-details/property-metas');
        ?>
Esempio n. 5
0
        ?>

                                </a>
                            </figure>
                            <h4><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
                            <p><?php 
        framework_excerpt(8);
        ?>
 <a href="<?php 
        the_permalink();
        ?>
"> <?php 
        _e('Know More', 'framework');
        ?>
 </a> </p>
                            <span class="price"><?php 
        property_price();
        ?>
</span>
                        </li>
                        <?php 
    }
    $theme_use_lightbox = get_option('theme_use_lightbox');
    if ($theme_use_lightbox == 'true') {
        $full_image_url = wp_get_attachment_url($image_id);
        echo '<a href="' . $full_image_url . '" title="' . get_the_title() . '" class="pretty-photo">';
        echo '<img src="' . $featured_image[0] . '" alt="' . get_the_title() . '">';
        echo '</a>';
    } else {
        echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" >';
        echo '<img src="' . $featured_image[0] . '" alt="' . get_the_title() . '">';
        echo '</a>';
    }
    ?>
        </div><!-- end of post thumb -->
        <?php 
}
?>

    <p><?php 
framework_excerpt(35);
?>
</p>

    <a href="<?php 
the_permalink();
?>
"  class="read-more"><?php 
_e('Read More', 'framework');
?>
</a>

</article>
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        if (empty($title)) {
            $title = false;
        }
        $number = absint($instance['number']);
        echo $before_widget;
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        $menu_query = new WP_Query(array('post_type' => 'menu-item', 'posts_per_page' => $number, 'meta_query' => array(array('key' => 'featured', 'value' => 'Yes', 'compare' => '='))));
        if ($menu_query->have_posts()) {
            while ($menu_query->have_posts()) {
                $menu_query->the_post();
                ?>
                <div class="sidebar-menu-item clearfix">
                    <h4><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                    <?php 
                if (has_post_thumbnail()) {
                    ?>
                        <figure>
                            <a href="<?php 
                    the_permalink();
                    ?>
">
                                <?php 
                    the_post_thumbnail('small-menu-thumbnail', array('class' => "sidebar-menu-thumb"));
                    ?>
                            </a>
                        </figure>
                        <?php 
                }
                ?>
                    <p>
                        <?php 
                framework_excerpt(10);
                ?>
                    </p>
                    <a class="read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'framework');
                ?>
</a>
                </div>
                <?php 
            }
        }
        echo $after_widget;
    }
        _e('On', 'framework');
        ?>
 <span class="date"> <?php 
        the_time('F d, Y');
        ?>
</span></span>
                        <span><?php 
        _e('by', 'framework');
        ?>
 <span class="author-link"><?php 
        the_author_posts_link();
        ?>
</span></span>
                    </div>
                    <p><?php 
        framework_excerpt(18);
        ?>
</p>
                    <a class="more-details" href="<?php 
        the_permalink();
        ?>
"><?php 
        _e('Read More ', 'framework');
        ?>
<i class="fa fa-caret-right"></i></a>
                </article>
                <?php 
    }
} else {
    ?>
_e('by', 'framework');
?>
 <span class="author-link"><?php 
the_author_posts_link();
?>
</span> <?php 
_e('in', 'framework');
?>
 <?php 
the_category(', ');
?>
 </span>
        </div>
    </header>
    <?php 
get_template_part("post-formats/{$format}");
?>

    <p><?php 
framework_excerpt(40);
?>
</p>
    <a class="real-btn" href="<?php 
the_permalink();
?>
"><?php 
_e('Read more', 'framework');
?>
</a>
</article>
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        if (empty($title)) {
            $title = false;
        }
        $number = absint($instance['number']);
        echo $before_widget;
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        // hide events that are older than 6am today (because some parties go past your bedtime)
        $today6am = strtotime('today 6:00') + get_option('gmt_offset') * 3600;
        // - query -
        global $wpdb;
        $querystr = "SELECT * FROM {$wpdb->posts} wposts, {$wpdb->postmeta} metastart, {$wpdb->postmeta} metaend\n                                                            WHERE (wposts.ID = metastart.post_id AND wposts.ID = metaend.post_id)\n                                                            AND (metaend.meta_key = 'event_enddate' AND metaend.meta_value > {$today6am} )\n                                                            AND metastart.meta_key = 'event_enddate'\n                                                            AND wposts.post_type = 'event'\n                                                            AND wposts.post_status = 'publish'\n                                                            ORDER BY metastart.meta_value ASC LIMIT {$number}";
        $events = $wpdb->get_results($querystr, OBJECT);
        if ($events) {
            global $post;
            foreach ($events as $post) {
                setup_postdata($post);
                ?>
                <div class="sidebar-menu-item clearfix">
                    <h4><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                    <?php 
                if (has_post_thumbnail()) {
                    ?>
                        <figure>
                            <a href="<?php 
                    the_permalink();
                    ?>
">
                                <?php 
                    the_post_thumbnail('square-menu-thumbnail', array('class' => "sidebar-menu-thumb"));
                    ?>
                            </a>
                        </figure>
                        <?php 
                }
                ?>
                    <p>
                        <?php 
                framework_excerpt(10);
                ?>
                    </p>
                    <a class="read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'framework');
                ?>
</a>
                </div>
                <?php 
            }
        }
        echo $after_widget;
    }
            ?>
">
                                                        <?php 
            the_post_thumbnail('post-thumbnail');
            ?>

                                                    </a>
                                                </figure>
                                                <?php 
        }
        ?>


                                            <div class="detail">
                                                <p><?php 
        framework_excerpt(45);
        ?>
</p>
                                                <?php 
        /* Agent Contact Info */
        $agent_mobile = get_post_meta($post->ID, 'REAL_HOMES_mobile_number', true);
        $agent_office_phone = get_post_meta($post->ID, 'REAL_HOMES_office_number', true);
        $agent_office_fax = get_post_meta($post->ID, 'REAL_HOMES_fax_number', true);
        if (!empty($agent_office_phone) || !empty($agent_mobile) || !empty($agent_office_fax)) {
            ?>

                                                    <p class="contact-types">
                                                        <?php 
            if (!empty($agent_office_phone)) {
                ?>
<em><?php 
Esempio n. 12
0
        echo '<a href="' . $full_image_url . '" title="' . get_the_title() . '" class="pretty-photo">';
        echo '<img src="' . $featured_image[0] . '" alt="' . get_the_title() . '">';
        echo '</a>';
    } else {
        echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" >';
        echo '<img src="' . $featured_image[0] . '" alt="' . get_the_title() . '">';
        echo '</a>';
    }
    ?>
            </div>
            <!-- end of post thumb -->
            <?php 
}
?>

        <p><?php 
framework_excerpt(25);
?>
</p>

        <a class="read-more" href="<?php 
the_permalink();
?>
"><?php 
_e('Read More', 'framework');
?>
</a>

    </div>

</article>
        </figure>
        <?php 
}
?>
    <div class="post-content">
        <h3 class="post-title">
            <a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a>
        </h3>
        <p><?php 
framework_excerpt(15);
?>
</p>
        <a class="read-more" href="<?php 
the_permalink();
?>
"><?php 
_e('Read More', 'framework');
?>
</a>
    </div>
    <div class="price"><span><?php 
echo get_post_meta($post->ID, 'menu_price', true);
?>
</span></div>
</article>
        <div class="detail">
            <h5 class="price">
                <?php 
property_price();
$type_terms = get_the_terms($post->ID, "property-type");
if (!empty($type_terms)) {
    echo '<small> - ';
    foreach ($type_terms as $type_term) {
        echo $type_term->name;
    }
    echo '</small>';
}
?>
            </h5>
            <p><?php 
framework_excerpt(30);
?>
</p>
            <a class="more-details" href="<?php 
the_permalink();
?>
"><?php 
_e('More Details ', 'framework');
?>
<i class="fa fa-caret-right"></i></a>
        </div>

        <div class="property-meta">
            <?php 
get_template_part('property-details/property-metas');
?>