Пример #1
0
 /**
  * @param number $post_id
 * @return html featured video code
 */
 function video_get_featured_video($post_id = null, $width = "", $height = "", $args = array())
 {
     if ($post_id == null) {
         $post_id = get_the_ID();
     }
     $res = '';
     if (video_has_featured_video($post_id)) {
         $meta = get_post_meta($post_id, META_VIDEO_FEATURED_URL, true);
         $res = get_video_embed_code($meta, $width, $height, $args);
     }
     return $res;
 }
echo $height;
?>
px; width: <?php 
echo $width;
?>
%;">
	<div class="inner-item video" style="width: 100%; height: 100%;">
	
		<?php 
if (function_exists("custom_display_badge")) {
    custom_display_badge();
}
?>
		
		<?php 
if (video_has_featured_video(get_the_ID())) {
    echo video_get_featured_video(get_the_ID(), "100%", "100%");
} else {
    if (is_admin()) {
        ?>
			<div class="no-content" style="min-height: 150px;"><i class="fa fa-ban"></i></div>
			<?php 
    }
}
?>
		<?php 
if (!is_admin()) {
    ?>
		<div class="has-more"><a class="post-link" href="<?php 
    the_permalink();
    ?>
Пример #3
0
 /**
  * retrieve default templates for specified post
  * @param number $post_id
  * @return string
 */
 function wall_get_default_template($post_id = null)
 {
     if ($post_id == null) {
         $post_id = get_the_ID();
     }
     $template = "content";
     if (custom_is_registered_tool('video') && video_has_featured_video($post_id)) {
         $template = "video";
     } else {
         if (has_post_thumbnail($post_id)) {
             $template = "thumb";
         }
     }
     return $template;
 }
Пример #4
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
defined('ABSPATH') or die("Go Away!");
?>
<article>
	<?php 
$has_video = false;
$has_thumb = false;
// featured video
if (custom_is_registered_tool('video') && video_has_featured_video(get_the_ID())) {
    $has_video = true;
    ?>
		<div class="video"><?php 
    echo video_get_featured_video(get_the_ID(), "100%", "100%");
    ?>
</div>
		<?php 
}
// featured thumbnail
if (!$has_video) {
    if (has_post_thumbnail()) {
        $attach_id = get_post_thumbnail_id(get_the_ID());
        if ($attach_id) {
            $image = wp_get_attachment_image_src($attach_id, 'full');
            if ($image) {