Example #1
0
/**
 * Show Column Content for Custom Post Type Fortman Team
 */
function columns_content_partners($column_name, $post_ID)
{
    if ($column_name == 'partners_image') {
        $post_featured_image = get_featured_image($post_ID);
        if ($post_featured_image) {
            echo '<div style="background:url(' . $post_featured_image . '); height: 64px; width: 64px; background-position: 50% 50%; background-size: cover"></div>';
        } else {
            echo 'No preview available';
        }
    }
}
Example #2
0
function add_columns_content($column_name, $post_ID)
{
    if ($column_name == 'featured_image') {
        $post_featured_image = get_featured_image($post_ID);
        if ($post_featured_image) {
            echo '<img width="100px" height="70px"  src="' . $post_featured_image . '" />';
        }
    }
    if ($column_name == 'name') {
        $post_name = get_post_custom_values('pr_name', $post_ID);
        if ($post_name) {
            echo '<label>';
            $post_type = get_post_status($post_ID);
            if ($post_type == 'trash') {
                $actionLinks = '<div class="row-actions"><span class="untrash"><a title="' . __('Restore this item', 'quotable') . '" href="' . wp_nonce_url(get_admin_url() . 'post.php?post=' . $post_ID . '&amp;action=untrash', 'untrash-' . $post_type . '_' . $post_ID) . '">' . __('Restore', 'quotable') . '</a> | </span>';
                $actionLinks .= '<span class="trash"><a href="' . wp_nonce_url(get_admin_url() . 'post.php?post=' . $post_ID . '&amp;action=delete', 'delete-' . $post_type . '_' . $post_ID) . '" title="' . __('Delete this item permanently', 'quotable') . '" class="submitdelete">' . __('Delete Permanently', 'quotable') . '</a></span>';
            } else {
                $actionLinks = '<div class="row-actions"><span class="edit"><a title="' . __('Edit this item', 'quotable') . '" href="' . get_admin_url() . 'post.php?post=' . $post_ID . '&amp;action=edit">Edit</a> | </span>';
                $actionLinks .= '<span class="inline hide-if-no-js"><a title="' . __('Edit this item inline', 'quotable') . '" class="editinline" href="#">Quick&nbsp;Edit</a> | </span>';
                $actionLinks .= '<span class="trash"><a href="' . wp_nonce_url(get_admin_url() . 'post.php?post=' . $post_ID . '&amp;action=trash', 'delete-post_' . $post_ID) . '" title="' . __('Move this item to the Trash', 'quotable') . '" class="submitdelete">Trash</a></span>';
            }
            echo $post_name[0] . $actionLinks;
            echo '</label>';
        }
    }
    if ($column_name == 'description') {
        $post_name = get_post_custom_values('pr_name', $post_ID);
        $post_description = get_post_custom_values('pr_description', $post_ID);
        if ($post_description) {
            echo '<label>';
            //printf(__('Description %s','vi'),$post_name[0]);
            echo $post_description[0] . '</label>';
            //echo '<pre>';
            //$id= 1;
            //print_r(get_post(1));
            //$post= get_post(1);
            //print_r(Post::getByConditions(array('post_type'=>'product')));
            //echo '</pre>';
        }
    }
}
"><a href="<?php 
    the_permalink();
    ?>
"
																																										 title="<?php 
    echo esc_attr(sprintf(__('Permalink to %s', 'smartadapt'), the_title_attribute('echo=0')));
    ?>
"
																																										 ><?php 
    the_post_thumbnail('two-column-thumbnail');
    ?>
</a></div>

                    <?php 
} elseif ($post_format == 'gallery') {
    $featured_image = get_featured_image('two-column-thumbnail');
    if (!empty($featured_image)) {
        ?>

									<div class="thumbnail-outer format-ico <?php 
        echo $post_format . 'post-ico';
        ?>
"><a href="<?php 
        the_permalink();
        ?>
"
																																												 title="<?php 
        echo esc_attr(sprintf(__('Permalink to %s', 'smartadapt'), the_title_attribute('echo=0')));
        ?>
"
											><?php 
Example #4
0
<?php

/*
* Gallery row snippet
*/
?>
<div class="columns sixteen">
	<?php 
$featured_image = get_featured_image('wide-image');
if ('' != get_the_post_thumbnail()) {
    ?>
		<div class="social-and-video-container">
			<div class="share-buttons-area social-column">
				<?php 
    smartadapt_get_social_buttons();
    ?>
			</div>
			<div class="comments-link">
				<?php 
    if (comments_open() && is_single()) {
        ?>
				<?php 
        comments_popup_link('<span class="leave-reply button  small square-button" title="' . __('Leave a reply', 'smartadapt') . '"><i class="icon-comment"></i></span>', '<i class="icon-comment"></i><span>' . __('1 Reply', 'smartadapt') . '</span>', '<i class="icon-comment"></i><span>' . __('% Replies', 'smartadapt') . '</span>');
        ?>

				<?php 
    }
    ?>
			</div>
			<div class="image-column">
				<div class="large-image-outer">
Example #5
0
    <div class="wrapper">
      <ul><?php 
$clients = get_posts(array('post_type' => 'client', 'posts_per_page', 4, 'orderby', 'rand'));
if (is_array($clients) && !empty($clients)) {
    foreach ($clients as $client) {
        $link = get_field('link', $client->ID);
        $new_window = get_field('new_window', $client->ID) === true ? ' target="_blank"' : '';
        ?>
<li class="nav-item"><a href="<?php 
        echo $link;
        ?>
"<?php 
        echo $new_window;
        ?>
><?php 
        echo get_featured_image('full', $client->ID, array('alt' => $client->post_title));
        ?>
</a></li><?php 
    }
}
wp_reset_postdata();
?>
      </ul>
    </div>
  </nav>
  <div class="wrapper">
    <div class="row">
      <div class="grid-box grid-box--desk--2of3">
        <nav class="nav nav--footer">
          <?php 
wp_nav_menu(array('container' => null, 'menu_class' => 'menu', 'theme_location' => 'secondary'));
    function widget($args, $instance)
    {
        $title = apply_filters('widget_title', $instance['title']);
        $limit = is_int($instance['gallery_limit']) ? $instance['gallery_limit'] : 4;
        extract($args);
        echo $before_widget;
        ?>
	<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $query = new WP_Query(array('posts_per_page' => $limit, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-gallery')))));
        if ($query->have_posts()) {
            ?>

		<div class="recent-gallery-box-container">
			<div class="row">
								<?php 
            while ($query->have_posts()) {
                $query->the_post();
                ?>
				<div class="columns eight">
					<div class="thumbnail-outer format-ico gallerypost-ico">
						<?php 
                $featured_image = get_featured_image('medium-image');
                if ('' != get_the_post_thumbnail()) {
                    ?>
							<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_post_thumbnail('medium-image');
                    ?>
</a>
							<?php 
                } else {
                    if (!empty($featured_image)) {
                        ?>
							<a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        echo $featured_image;
                        ?>
</a>
							<?php 
                    }
                }
                ?>
</div>
		</div>

		<?php 
            }
            wp_reset_query();
            ?>
		</div>
		</div>
		<?php 
            echo $after_widget;
            ?>
	<?php 
        }
    }
Example #7
0
 function question_view($content)
 {
     $this->output('<div class="question-main">');
     $this->cs_position('Content Top');
     $this->output('<div class="row">');
     $this->output('<div class="col-md-8 question-c-l">');
     $this->main_parts($content);
     $this->output('</div>');
     $this->output('<div class="col-md-4 question-sidebar">');
     if (isset($content['q_view']['raw']['postid'])) {
         $featured_image = get_featured_image($content['q_view']['raw']['postid']);
         if ($featured_image) {
             $this->output('<div class="widget">');
             $this->output('<h3 class="widget-title">' . qa_lang('cleanstrap/featured_image') . '</h3>');
             $this->output('<div class="question-image-container">');
             $this->output($featured_image);
             $this->output('</div>');
             $this->output('</div>');
         }
     }
     $this->cs_position('Question Right');
     $this->output('</div>');
     $this->output('</div>');
     $this->output('</div>');
 }
Example #8
0
				<?php 
bloginfo('name');
echo " - ";
the_date('Y');
?>
			</div>

			<nav class="footer-nav">
				<?php 
$args = array('theme_location' => 'footer', 'container' => false);
?>
				<?php 
wp_nav_menu($args);
?>
				</ul>
			</nav>

			<img src="<?php 
echo get_featured_image(26);
?>
" alt="" class="footer-logo">

		</div> <!-- .footer-content -->

	</footer>

	<?php 
wp_footer();
?>
</body>
</html>
Example #9
0
		<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
">

<link type="text/css" href="<?php 
echo get_stylesheet_directory_uri();
?>
/demo.css" rel="stylesheet">
<?php 
wp_head();
?>

<?php 
$header = get_featured_image();
if ($header == '' && !is_page(2)) {
    $header = site_url() . '/wp-content/uploads/2014/11/header.jpg';
}
?>

<style type="text/css">

.header { background:url(<?php 
echo $header;
?>
) center top no-repeat; background-size:cover; }

</style>

<!-- GOOGLE ANALYTICS -->
Example #10
0
/**
 * Displays the url of the post featured image
 * @param array $params
 */
function the_featured_image($params = array())
{
    $params = wp_parse_args($params);
    # override object param
    $params['object'] = FALSE;
    $fi = get_featured_image($params);
    echo empty($fi) ? WPTT_DEFAULT_IMAGE : $fi;
}
/**
 * Display related post
 */
function smartadapt_get_related_post($category, $post_ID, $display_post_limit, $columns_per_slide = 4)
{
    global $post;
    $args = array('cat' => $category, 'post__not_in' => array($post_ID * -1), 'posts_per_page' => $display_post_limit);
    $query = new WP_Query($args);
    $limit = $query->found_posts;
    if ($limit > 0) {
        ?>
	<section class="related-posts row">
		<div class="columns sixteen"><h3><?php 
        _e('Related posts', 'smartadapt');
        ?>
</h3>

			<div class="slider-container">
				<ul class="related-posts-list slider-list slides">
					<?php 
        $i = 1;
        $j = 1;
        while ($query->have_posts()) {
            $query->the_post();
            $post_format = get_post_format();
            if ($i == 1) {
                echo '<li><div class="row">';
            }
            ?>
						<div class="columns <?php 
            echo smartadapt_column_class_by_number(4);
            ?>
 small-box">
							<?php 
            if ('' != get_the_post_thumbnail()) {
                ?>
								<div class="thumbnail-outer-small format-ico <?php 
                echo $post_format . '-ico';
                ?>
">
									<a href="<?php 
                the_permalink();
                ?>
"
										 title="<?php 
                echo esc_attr(sprintf(__('Permalink to %s', 'smartadapt'), the_title_attribute('echo=0')));
                ?>
"
											><?php 
                the_post_thumbnail('two-column-thumbnail');
                ?>
</a></div>

								<?php 
            } elseif ($post_format == 'gallery') {
                $featured_image = get_featured_image('two-column-thumbnail');
                if (!empty($featured_image)) {
                    ?>

									<div class="thumbnail-outer-small format-ico <?php 
                    echo $post_format . 'post-ico';
                    ?>
">
										<a href="<?php 
                    the_permalink();
                    ?>
"
											 title="<?php 
                    echo esc_attr(sprintf(__('Permalink to %s', 'smartadapt'), the_title_attribute('echo=0')));
                    ?>
"
												><?php 
                    echo $featured_image;
                    ?>
</a></div>

									<?php 
                }
            }
            ?>
							<h4><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h4>
							<?php 
            if (empty($featured_image) && '' == get_the_post_thumbnail()) {
                ?>
							<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_excerpt();
                ?>
</a>
							<?php 
            }
            ?>
						</div>

						<?php 
            if ($i % $columns_per_slide == 0 || $j == $limit) {
                echo '</div></li>';
                $i = 1;
            } else {
                $i++;
            }
            $j++;
        }
        // end while
        wp_reset_query();
        ?>
				</ul>
			</div>
		</div>
		<script type="text/javascript" charset="utf-8">
			(function ($) {
				"use strict";
			$('.slider-container').flexslider();
			})(jQuery);
		</script>
	</section>
	<?php 
    }
    //if limit >0
}
Example #12
0
function team($atts, $content = null)
{
    extract(shortcode_atts(array(), $atts));
    $text = '';
    $text .= '<div class="team-members"><hr>';
    // Get Team Members:
    $type = 'team';
    $args = array('post_type' => $type, 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts' => 1);
    $my_query = null;
    $my_query = new WP_Query($args);
    if ($my_query->have_posts()) {
        while ($my_query->have_posts()) {
            $my_query->the_post();
            // Variables
            $title = get_the_title();
            $position = get_field('team_position');
            $phone = get_field('team_phone_number');
            $email = get_field('team_email');
            $image = get_featured_image();
            $text .= '<div class="col-sm-4 col-xs-12 teamMember">';
            $text .= '	<img src="' . $image . '">';
            $text .= '	<h2>' . $title . '</h2>';
            $text .= '	<p>' . $position . '</p>';
            $text .= '	<ul class="contact">';
            $text .= '		<li class="email"><a href="mailto:' . $email . '">' . $email . '</a></li>';
            $text .= '		<li class="phone">' . $phone . '</li>';
            $text .= '	</ul>';
            $text .= '</div>';
        }
    }
    wp_reset_query();
    $text .= '<br clear="all"></div>';
    return $text;
}
Example #13
0
/**
 * Show Column Content for Custom Post Type Fortman Team
 */
function columns_content_talents($column_name, $post_ID)
{
    if ($column_name == 'talent_image') {
        $post_featured_image = get_featured_image($post_ID);
        if ($post_featured_image) {
            echo '<div style="background:url(' . $post_featured_image . '); height: 64px; width: 64px; background-position: 50% 50%; background-size: cover"></div>';
        } else {
            echo 'No preview available';
        }
    } else {
        if ($column_name == 'talent-name') {
            $post_talent_name = get_field('talent_name', $post_ID);
            if ($post_talent_name) {
                echo $post_talent_name;
            } else {
                echo 'n/a';
            }
        } else {
            if ($column_name == 'expertise') {
                $expertise = get_field('expertise', $post_ID);
                if ($expertise) {
                    echo $expertise;
                } else {
                    echo 'n/a';
                }
            }
        }
    }
}
Example #14
0
function post_single($post)
{
    //GET DATA FOR DISPLAY
    $post->featured_image_url = get_featured_image($post);
    // CATEGORY LISTING
    $categories = get_the_category($post->ID);
    $categoryCounter = count($categories) - 1;
    // Total # of elems in array adjusted for 0 base
    $i = 0;
    $catstring = '';
    if ($categories) {
        $catstring .= '<div><h4>Categorized:</h4><ul>';
        foreach ($categories as $cat) {
            if ($i != $categoryCounter) {
                // If it's not the last one...
                $catstring .= '<li><a href="' . get_category_link($cat->term_id) . '" title="see more ' . $cat->name . '">' . $cat->name . '</a>, </li>';
            } else {
                // If it is...
                $catstring .= '<li><a href="' . get_category_link($cat->term_id) . '" title="see more ' . $cat->name . '">' . $cat->name . '</a></li>';
            }
            $i++;
        }
        $catstring .= '</p></div>';
    } else {
        $catstring .= '';
    }
    // TAG LISTING
    $posttags = get_the_tags($post->ID);
    $tagCounter = count($posttags) - 1;
    $j = 0;
    $tagstring = '';
    if ($posttags) {
        $tagstring .= '<div><h4>Tagged:</h4><ul>';
        foreach ($posttags as $tag) {
            if ($j != $tagCounter) {
                $tagstring .= '<li><a href="' . get_tag_link($tag->term_id) . '" title="see more ' . $tag->name . '">' . $tag->name . '</a>, </li>';
            } else {
                $tagstring .= '<li><a href="' . get_tag_link($tag->term_id) . '" title="see more ' . $tag->name . '">' . $tag->name . '</a></li>';
            }
            $j++;
        }
        $tagstring .= '</ul></div>';
    } else {
        $tagstring .= '';
    }
    $postTitleURL = str_replace('#', '%23', $post->post_title);
    $year = get_the_date('Y');
    $month = get_the_date('m');
    $monthFull = get_the_date('F');
    $monthArchive = get_month_link($year, $month);
    $authorID = $post->post_author;
    $authorDisplayName = get_the_author_meta('display_name', $authorID);
    //$author = the_author($authorID);
    $content = apply_filters('the_content', $post->post_content);
    $postHTML = '' . '<article id="post-' . $post->ID . '" class="single">' . '<header>' . '<h2><a id="post-title" href="' . $post->guid . '" title="' . $post->post_title . '">' . $post->post_title . '</a></h2>' . '<h3>By: ' . '<a class="author-archive" href="' . get_author_posts_url($authorID) . '" title="see more posts by ' . $authorDisplayName . '">' . $authorDisplayName . '</a><br>' . 'On: ' . '<a class="month-archive" href="' . $monthArchive . '" title="see more posts during the month of ' . $monthFull . '">' . get_the_date() . '</a>' . '</h3>' . '<ul class="social-nav post-social">' . '<li class="fb-link"><a class="icon" title="Share on Facebook" href="http://www.facebook.com/sharer.php?u=' . $post->guid . '" target="_blank">6</a></li>' . '<li class="tw-link"><a class="icon" title="Tweet on Twitter" href="http://twitter.com/share?text=' . $post->post_title . '&url=' . $post->guid . '" target="_blank">7</a></li>' . '<li class="pin-link"><a class="icon" title="Share on Shop Your Way" href="http://pinterest.com/pin/create/button/?url=' . $post->guid . '&media=' . $post->featured_image_url . '&description=' . $post->post_title . '" target="_blank">8</a></li>' . '</ul>' . '<!-- <a class="featured-image" href="' . $post->guid . '" title="' . $post->post_title . '" style="background-image:url(' . $post->featured_image_url . ');"></a> -->' . '</header>' . '<div class="entry-content">' . '' . $content . '' . '</div>' . '<div class="post-tax">' . $catstring . $tagstring . '</div>' . '</article>';
    return $postHTML;
}
Example #15
0
/**
 * Show Column Content for Custom Post Type Fortman Team
 */
function columns_content_works($column_name, $post_ID)
{
    if ($column_name == 'event_image') {
        $post_featured_image = get_featured_image($post_ID);
        if ($post_featured_image) {
            echo '<div style="background:url(' . $post_featured_image . '); height: 64px; width: 64px; background-position: 50% 50%; background-size: cover"></div>';
        } else {
            echo 'No preview available';
        }
    } else {
        if ($column_name == 'event-date') {
            $event_date = get_field('event_date', $post_ID);
            if ($event_date) {
                echo $event_date;
            } else {
                echo 'n/a';
            }
        } else {
            if ($column_name == 'location') {
                $location = get_field('location', $post_ID);
                if ($location) {
                    echo $location;
                } else {
                    echo 'n/a';
                }
            }
        }
    }
}
Example #16
0
?>
                <span
                    class="meta-label meta-publisher vcard"><?php 
_e('Published by: ', 'smartadapt');
?>
 <?php 
the_author_posts_link();
?>
 </span>
            </p>
        </header>
        <!-- .entry-header -->
        <div class="row">
            <div class="columns sixteen">
                <?php 
$featured_image = get_featured_image('single-post-small');
$post_format = get_post_format();
if ('' != get_the_post_thumbnail()) {
    ?>
                    <div class="thumbnail-outer format-ico <?php 
    echo $post_format . 'post-ico';
    ?>
"><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_post_thumbnail('single-post-small');
    ?>
</a></div>

                    <?php 
<?php

/**
 * Template Name: Destination Page
 *
 * @package WordPress
 * @subpackage TheWishingWellWA
 * @since TheWishingWellWA 1.0
 */
get_header();
?>
    
<section class="destination-page-title clear-fix">
    <div class="destination-title-img clear-fix">
            <?php 
get_featured_image();
?>
    </div>
    <div class="destination-title-excerpt">
        <h1 class="destination-title"><?php 
the_title();
?>
</h1>
        <span class="destination-title-text"><?php 
the_excerpt();
?>
</span>
    </div>  
</section> 
<article class="destination-content">
<!-- Need to use The Loop to get page content -->