public function _callback_get_custom_locations($atts)
 {
     $rows = fw_akg('data_provider/custom/locations', $atts, array());
     $result = array();
     if (!empty($rows)) {
         foreach ($rows as $key => $row) {
             $result[$key]['title'] = fw_akg('title', $row);
             $result[$key]['url'] = fw_akg('url', $row);
             $result[$key]['thumb'] = fw_resize(wp_get_attachment_url(fw_akg('thumb/attachment_id', $row)), 100, 60, true);
             $result[$key]['coordinates'] = fw_akg('location/coordinates', $row);
             $result[$key]['description'] = fw_akg('description', $row);
         }
     }
     return $result;
 }
Exemplo n.º 2
0
        ?>
</span>
                    <?php 
        echo $feature2['subtitle'];
        ?>
                </h3>
            <?php 
    }
    ?>
        </header>
        <ol class="list-b b">
            <?php 
    if (!empty($feature2['image'])) {
        ?>
                <li class="mobile-g"><img src="<?php 
        echo esc_url(fw_resize($feature2['image']['url'], 675, 372));
        ?>
" alt="" width="675" height="372"></li>
            <?php 
    }
    ?>

            <?php 
    if (!empty($feature2['features'])) {
        ?>
                <?php 
        foreach ($feature2['features'] as $feature) {
            ?>
                    <li>
                        <span class="title"><?php 
            echo esc_html($feature['title']);
Exemplo n.º 3
0
/**
 * @var string $the_content
 */
$fw_ext_projects_gallery_image = fw()->extensions->get('portfolio')->get_config('image_sizes');
$fw_ext_projects_gallery_image = $fw_ext_projects_gallery_image['gallery-image'];
$thumbnails = fw_ext_portfolio_get_gallery_images();
$captions = array();
if (!empty($thumbnails)) {
    ?>
	<section class="wrap-nivoslider theme-default">
		<div id="slider" class="nivoslider">
			<?php 
    foreach ($thumbnails as $thumbnail) {
        $attachment = get_post($thumbnail['attachment_id']);
        $captions[$thumbnail['attachment_id']] = $attachment->post_title;
        $image = fw_resize($thumbnail['attachment_id'], $fw_ext_projects_gallery_image['width'], $fw_ext_projects_gallery_image['height'], $fw_ext_projects_gallery_image['crop']);
        ?>
				<img src="<?php 
        echo esc_attr($image);
        ?>
"
				     class="nivoslider-image"
				     alt="<?php 
        echo esc_attr($attachment->post_title);
        ?>
"
				     title="#nivoslider-caption-<?php 
        echo esc_attr($attachment->ID);
        ?>
"
				     width="<?php 
Exemplo n.º 4
0
		});
	</script>
	<!--Slider-->
	<section class="wrap-nivoslider theme-default">
		<div class="nivoSlider">
			<?php 
    foreach ($data['slides'] as $id => $slide) {
        ?>
			<img  width='<?php 
        echo $dimensions['width'];
        ?>
' height="<?php 
        echo $dimensions['height'];
        ?>
" src="<?php 
        echo fw_resize($slide['src'], $dimensions['width'], $dimensions['height'], true);
        ?>
" alt="<?php 
        echo $slide['title'];
        ?>
" title="#nivo-<?php 
        echo $id;
        ?>
"/>
			<?php 
    }
    ?>
		</div>
		<?php 
    foreach ($data['slides'] as $id => $slide) {
        ?>
 /**
  * @internal
  *
  * @param string $column_name
  * @param int $id
  */
 public function _action_admin_manage_custom_column($column_name, $id)
 {
     switch ($column_name) {
         case 'image':
             if (get_the_post_thumbnail(intval($id))) {
                 $value = '<a href="' . get_edit_post_link($id, true) . '" title="' . esc_attr(__('Edit this item', 'fw')) . '">' . '<img src="' . fw_resize(get_post_thumbnail_id(intval($id)), 150, 100, true) . '" width="150" height="100" >' . '</a>';
             } else {
                 $value = '<img src="' . $this->get_declared_URI('/static/images/no-image.png') . '"/>';
             }
             echo $value;
             break;
         default:
             break;
     }
 }
Exemplo n.º 6
0
$permalink = get_permalink();
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID), 'post-thumbnails');
?>
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
    <header>
        <?php 
if (!empty($image)) {
    ?>
            <?php 
    $image = defined('FW') ? esc_url(fw_resize($image, 700, 316)) : esc_url($image);
    ?>
            <figure><img src="<?php 
    echo $image;
    ?>
" alt="<?php 
    the_title();
    ?>
" width="700" height="316"></figure>
        <?php 
}
?>
        <h3><?php 
the_title();
?>
</h3>
Exemplo n.º 7
0
    $thumbnail_title = $thumbnail->post_title;
} else {
    $image = '';
    $thumbnail_title = '';
}
?>
<li>
    <a href="<?php 
the_permalink();
?>
">
        <?php 
if (!empty($image)) {
    ?>
            <img src="<?php 
    echo esc_url(fw_resize($image[0], 328, 311));
    ?>
" alt="<?php 
    echo $thumbnail_title;
    ?>
" width="328" height="311">
        <?php 
}
?>
        <span>
            <span class="strong"><?php 
the_title();
?>
</span>
            <span class="date"><?php 
echo get_the_date();
Exemplo n.º 8
0
<?php

if (!defined('FW')) {
    die('Forbidden');
}
/**
 * @var array $atts
 */
if (empty($atts['image'])) {
    return;
}
$width = is_numeric($atts['width']) && $atts['width'] > 0 ? $atts['width'] : '';
$height = is_numeric($atts['height']) && $atts['height'] > 0 ? $atts['height'] : '';
if (!empty($width) && !empty($height)) {
    $image = fw_resize($atts['image']['attachment_id'], $width, $height, true);
} else {
    $image = $atts['image']['url'];
}
?>

<?php 
if (empty($atts['link'])) {
    ?>
	<img src="<?php 
    echo $image;
    ?>
" alt="<?php 
    echo $image;
    ?>
" width="<?php 
    echo $width;
Exemplo n.º 9
0
    echo $atts['demo_text'];
    ?>
</p>

<?php 
}
?>

<?php 
if (!empty($atts['demo_edit'])) {
    ?>
    
     <?php 
    echo $atts['demo_edit'];
    ?>

<?php 
}
?>

<?php 
if (!empty($atts['demo_img'])) {
    ?>
    
     <img src="<?php 
    echo fw_resize($atts['demo_img'][url], 800, 600, true);
    ?>
" alt="Alt">

<?php 
}
Exemplo n.º 10
0
            global $post;
            ?>
                    <?php 
            $permalink = get_permalink();
            $image = wp_get_attachment_url(get_post_thumbnail_id($post->ID), 'post-thumbnails');
            ?>
                    <?php 
            if (!empty($image)) {
                ?>
                        <li>
                            <a href="<?php 
                echo esc_url($permalink);
                ?>
">
                                <img src="<?php 
                echo esc_url(fw_resize($image, 540, 360));
                ?>
" alt="" width="540" height="360">
                                <span class="title">
                                    <?php 
                the_title();
                ?>
                                </span>
                                <span class="description"><?php 
                echo get_the_excerpt();
                ?>
</span>
                                <span class="link"><?php 
                _e('View more', 'fw');
                ?>
</span>
Exemplo n.º 11
0
	<!--Slider-->
	<section class="wrap-nivoslider theme-default">
		<div class="nivoSlider">
			<?php 
    foreach ($data['slides'] as $id => $slide) {
        ?>
			<img  width="<?php 
        echo esc_attr($dimensions['width']);
        ?>
"
			      height="<?php 
        echo esc_attr($dimensions['height']);
        ?>
"
			      src="<?php 
        echo esc_attr(fw_resize($slide['src'], $dimensions['width'], $dimensions['height'], true));
        ?>
"
			      alt="<?php 
        echo esc_attr($slide['title']);
        ?>
"
			      title="#nivo-<?php 
        echo esc_attr($id);
        ?>
" />
			<?php 
    }
    ?>
		</div>
		<?php 
 /**
  * @internal
  */
 public static function _action_ajax_resize_slide()
 {
     $thumb_size = json_decode(FW_Request::POST('thumb_size'), true);
     wp_send_json(array('src' => fw_resize(FW_Request::POST('src'), $thumb_size['width'], $thumb_size['height'], true)));
 }
Exemplo n.º 13
0
$fw_ext_projects_gallery_image = $fw_ext_projects_gallery_image['gallery-image'];
$thumbnails = fw_ext_portfolio_get_gallery_images();
$captions = array();
if (!empty($thumbnails)) {
    ?>
	<section class="wrap-nivoslider theme-default">
		<div id="slider" class="nivoslider">
            
			<?php 
    $i2 = 0;
    foreach ($thumbnails as $thumbnail) {
        $attachment = get_post($thumbnail['attachment_id']);
        $captions[$thumbnail['attachment_id']] = $attachment->post_title;
        $image_castume = wp_get_attachment_image_src($thumbnail['attachment_id'], 'slide-h1080');
        $image_castume_mini = wp_get_attachment_image_src($thumbnail['attachment_id'], 'thumbnail');
        $image = fw_resize($thumbnail['attachment_id'], 9999, 1080, true);
        $image = $image_castume[0];
        ?>
				<img data-src="<?php 
        echo $image_castume_mini[0];
        ?>
" src="<?php 
        echo esc_attr($image);
        ?>
"
				     id="img-id-<?php 
        echo $i2;
        ?>
" 
                     class="nivoslider-image"
				     alt="<?php 
Exemplo n.º 14
0
 /**
  *  Generate array with: recent/popular/most commented posts
  * @param string $sort Sort type (recent/popular/most commented)
  * @param integer $items Number of items to be extracted
  * @param boolean $image_post Extract or no post image
  * @param integer $image_width Set width of post image
  * @param integer $image_height Set height of post image
  * @param string $image_class Set class of post image
  * @param boolean $date_post Extract or no post date
  * @param string $date_format Set date format
  * @param string $post_type Set post type
  * @param string $category Set category from where posts would be extracted
  */
 function fw_theme_get_posts($args = null)
 {
     $defaults = array('sort' => 'recent', 'items' => 5, 'image_post' => true, 'return_image_tag' => true, 'image_width' => 54, 'image_height' => 54, 'image_class' => 'thumbnail', 'date_post' => true, 'date_format' => 'F jS, Y', 'post_type' => 'post', 'category' => '', 'excerpt_length' => 40);
     extract(wp_parse_args($args, $defaults));
     global $post;
     $fw_cat_ID = !empty($category) ? get_cat_ID($category) : '';
     if ($sort == 'recent') {
         $query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'post_date', 'order ' => 'DESC', 'cat' => $fw_cat_ID, 'posts_per_page' => $items));
         $posts = $query->get_posts();
     } elseif ($sort == 'popular') {
         $query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'meta_value', 'meta_key' => 'fw_post_views', 'order ' => 'DESC', 'cat' => $fw_cat_ID, 'posts_per_page' => $items));
         $posts = $query->get_posts();
     } elseif ($sort == 'commented') {
         $query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'comment_count', 'order ' => 'DESC', 'cat' => $fw_cat_ID, 'posts_per_page' => $items));
         $posts = $query->get_posts();
     } else {
         return false;
     }
     $fw_post_option = array();
     $count = 0;
     if (!empty($posts)) {
         foreach ($posts as $post_elm) {
             setup_postdata($post_elm);
             $img = '';
             if ($image_post == true) {
                 $post_thumbnail_id = get_post_thumbnail_id($post_elm->ID);
                 $post_thumbnail = wp_get_attachment_image_src($post_thumbnail_id, 'large');
                 if (!empty($post_thumbnail)) {
                     $image = fw_resize($post_thumbnail[0], $image_width, $image_height, true);
                     $img = $image;
                     if ($return_image_tag) {
                         $img = '<img src="' . $image . '" class="' . $image_class . '" alt="' . get_the_title($post_thumbnail_id) . '" width="' . $image_width . '" height="' . $image_height . '" />';
                     }
                 }
             }
             if (!empty($img)) {
                 $fw_post_option[$count]['post_img'] = $img;
             } else {
                 $fw_post_option[$count]['post_img'] = '';
             }
             if ($date_post) {
                 $time_format = apply_filters('_filter_widget_time_format', $date_format);
                 $fw_post_option[$count]['post_date_post'] = get_the_time($time_format, $post_elm->ID);
             } else {
                 $fw_post_option[$count]['post_date_post'] = '';
             }
             $fw_post_option[$count]['post_class'] = is_singular() && $post->ID == $post_elm->ID ? 'current-menu-item post_' . $sort : 'post_' . $sort;
             $fw_post_option[$count]['post_title'] = get_the_title($post_elm->ID);
             $fw_post_option[$count]['post_link'] = esc_url(get_permalink($post_elm->ID));
             $fw_post_option[$count]['post_author_link'] = get_author_posts_url(get_the_author_meta('ID'));
             $fw_post_option[$count]['post_author_name'] = get_the_author();
             $fw_post_option[$count]['post_comment_numb'] = get_comments_number($post_elm->ID);
             $fw_post_option[$count]['post_excerpt'] = isset($post) ? get_the_excerpt() : '';
             $count++;
         }
         wp_reset_postdata();
     }
     return $fw_post_option;
 }
 /**
  * Get all/by_category event's locations from db
  *
  * @param array $atts
  *
  * @return array
  */
 public function fw_get_events_locations($atts)
 {
     $category = fw_akg('data_provider/' . $this->data_provider_id . '/events_category', $atts);
     $args = array('post_type' => $this->parent->get_post_type_name(), 'posts_per_page' => -1, 'post_status' => 'publish');
     $terms_ids = array();
     $with_category = false;
     if (preg_match('/^\\d+$/', $category)) {
         $terms_ids = get_term_children($category, $this->parent->get_taxonomy_name());
         if (is_array($terms_ids) and false === empty($terms_ids) and false === is_wp_error($terms_ids)) {
             $terms_ids[] = (int) $category;
         } else {
             $terms_ids = array($category);
         }
         $with_category = true;
     }
     if ($with_category) {
         $args['tax_query'] = array(array('taxonomy' => $this->parent->get_taxonomy_name(), 'field' => 'id', 'terms' => $terms_ids, 'operator' => 'IN'));
     }
     $query = new WP_Query($args);
     $posts = $query->get_posts();
     wp_reset_query();
     $result = array();
     if (is_array($posts) && count($posts) > 0) {
         foreach ($posts as $key => $post) {
             $meta = fw_get_db_post_option($post->ID, $this->parent->get_event_option_id());
             $location = trim(fw_akg('event_location/location', $meta, ''));
             if (false === empty($location)) {
                 $result[$key]['title'] = htmlspecialchars_decode($post->post_title);
                 $result[$key]['coordinates'] = fw_akg('event_location/coordinates', $meta, array());
                 $result[$key]['url'] = get_permalink($post->ID);
                 $result[$key]['thumb'] = fw_resize(wp_get_attachment_url(get_post_thumbnail_id($post->ID)), 100, 60, true);
                 $result[$key]['description'] = $location;
             }
         }
     }
     return $result;
 }
Exemplo n.º 16
0
$thumbnails_params = $loop_data['image_sizes']['featured-image'];
?>
<li class="mix category_all <?php 
echo !empty($loop_data['listing_classes'][get_the_ID()]) ? $loop_data['listing_classes'][get_the_ID()] : '';
?>
 portfolio-item">
	<div class="portfolio-img">
		<a href="<?php 
the_permalink();
?>
">
			<?php 
$thumbnail_id = get_post_thumbnail_id();
if (!empty($thumbnail_id)) {
    $thumbnail = get_post($thumbnail_id);
    $image = fw_resize($thumbnail->ID, $thumbnails_params['width'], $thumbnails_params['height'], $thumbnails_params['crop']);
    $thumbnail_title = $thumbnail->post_title;
} else {
    $image = fw()->extensions->get('portfolio')->locate_URI('/static/img/no-photo.jpg');
    $thumbnail_title = $image;
}
?>
			<img src="<?php 
echo $image;
?>
" alt="<?php 
echo $thumbnail_title;
?>
"
			     width="<?php 
echo $thumbnails_params['width'];