本文整理汇总了PHP中yit_work_permalink函数的典型用法代码示例。如果您正苦于以下问题:PHP yit_work_permalink函数的具体用法?PHP yit_work_permalink怎么用?PHP yit_work_permalink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了yit_work_permalink函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$yit_portfolio = yit_portfolios();
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title']);
$project_fx = isset($instance['project_fx']) ? $instance['project_fx'] : false;
$project_easing_fx = isset($instance['project_easing_fx']) ? $instance['project_easing_fx'] : false;
$project_speed_fx = isset($instance['project_speed_fx']) ? $instance['project_speed_fx'] : false;
$project_timeout_fx = isset($instance['project_timeout_fx']) ? $instance['project_timeout_fx'] : false;
$project_n_items = isset($instance['project_n_items']) ? $instance['project_n_items'] : 5;
$project_post_types = isset($instance['project_post_type']) ? $instance['project_post_type'] : 'portfolio';
global $more;
$more = 0;
$post_type = $project_post_types;
if ($project_post_types) {
foreach ($yit_portfolio as $portfolio) {
if ($portfolio->ID == $project_post_types) {
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
echo '<div class="featured-projects-widget flexslider">';
echo '<ul class="slides">';
yit_set_portfolio_loop($portfolio->ID);
$i = 0;
$categories = yit_portfolio_get_setting('categories', $portfolio->ID);
$portfolios = yit_portfolio_get_setting('items', $portfolio->ID);
foreach ($portfolios as $item_id => $item) {
$post_permalink = yit_work_permalink($item_id);
echo '<li>';
echo '<div class="thumb-project">';
echo "<a href='" . $post_permalink . "'>";
yit_image("id={$item_id}&size=featured_project_thumb");
//echo wp_get_attachment_image( $item_id, 'featured_project_thumb' );
echo '</a></div>';
echo '<h4>' . $item['title'] . '</h4>';
echo '<p class="categories">';
$str_categories = '';
$terms = isset($item['terms']) ? $item['terms'] : array();
foreach ($terms as $name) {
$str_categories .= "<a href='" . yit_term_link($name) . "'>{$categories[$name]}</a>, ";
}
echo substr($str_categories, 0, strlen($str_categories) - 2);
echo '</p>';
echo '</li>';
if (++$i == $project_n_items) {
break;
}
}
echo '</ul>';
echo '</div>';
$script = "<script type=\"text/javascript\">\n\t\t jQuery(document).ready(function(\$){\n\t\t \tvar animation = \$.browser.msie || \$.browser.opera ? 'fade' : '{$project_fx}';\n\t\t \$('.featured-projects-widget').flexslider({\n\t\t animation: animation,\n\t\t slideshowSpeed: {$project_timeout_fx},\n\t\t animationSpeed: {$project_speed_fx},\n\t\t selectors: 'ul > li',\n\t\t directionNav: true,\n\t\t slideshow: true,\n\n\t\t\t\t\t\t pauseOnAction: false,\n\t\t\t\t\t\t controlNav: false,\n\t\t\t\t\t\t touch: true\n\t\t });\n\t\t });\n\t\t </script>";
echo $script;
echo $after_widget;
}
}
}
}
开发者ID:zgomotos,项目名称:Bazar,代码行数:59,代码来源:featured_projects.php
示例2: yit_work_get
$classes = 'first';
} else {
$classes = '';
}
$classes .= " one-third";
*/
$columns = yit_work_get('columns') ? yit_work_get('columns') : 3;
$classes = "work span" . 12 / $columns;
if ($i % $columns == 1) {
$classes .= ' first';
}
$video_url = yit_work_get('video_url');
$image_url = yit_work_get('image_url');
$image_id = yit_work_get('item_id');
$post_permalink = yit_work_permalink($image_id);
?>
<li <?php
yit_work_class($classes);
?>
>
<?php
$class = '';
if (!empty($video_url)) {
list($video_type, $video_id) = explode(':', yit_video_type_by_url($video_url));
if ($video_type == 'youtube') {
$video_url = 'http://www.youtube.com/embed/' . $video_id . '?width=640&height=480&iframe=true';
} else {
if ($video_type == 'vimeo') {
开发者ID:zgomotos,项目名称:Bazar,代码行数:31,代码来源:markup.php
示例3: widget
function widget($args, $instance)
{
$yit_portfolio = yit_portfolios();
extract($args);
$project_speed_fx = isset($instance['project_speed_fx']) ? $instance['project_speed_fx'] : false;
$project_n_items = isset($instance['project_n_items']) ? $instance['project_n_items'] : 5;
$project_post_types = isset($instance['project_post_type']) ? $instance['project_post_type'] : false;
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title']);
//if ( ! $project_post_types || empty( $project_post_types ) )
// $post_type = get_post_meta( get_the_ID(), '_portfolio_post_type', true );
//else
$post_type = $project_post_types;
//if ( empty( $post_type ) )
// $post_type = get_post_type();
//$portfolio_tax = sanitize_title( $yit_portfolio[$post_type]['tax'] );
global $more;
$more = 0;
if ($project_post_types) {
foreach ($yit_portfolio as $portfolio) {
if ($portfolio->ID == $project_post_types) {
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
$categories = yit_portfolio_get_setting('categories', $portfolio->ID);
$portfolios = yit_portfolio_get_setting('items', $portfolio->ID);
$is_slider = count($portfolios) > 1 ? true : false;
echo '<div class="more-projects-widget">';
if ($is_slider) {
echo '<div class="top">';
echo '<a class="prev" href="#">Prev</a>';
echo '</div>';
}
echo '<div class="sliderWrap">';
echo '<ul>';
//loop
yit_set_portfolio_loop($portfolio->ID);
foreach ($portfolios as $item_id => $item) {
$post_permalink = yit_work_permalink($item_id);
list($thumbnail_url, $thumbnail_width, $thumbnail_height) = wp_get_attachment_image_src($item_id, 'blog_thumb');
echo '<li class="work-item group">';
echo '<a class="work-thumb" href="' . $post_permalink . '">';
echo wp_get_attachment_image($item_id, 'blog_thumb');
echo '</a>';
echo '<a class="meta work-title" href="' . $post_permalink . '">' . $item['title'] . '</a>';
echo '<p class="meta categories">';
$str_categories = '';
$terms = isset($item['terms']) ? $item['terms'] : array();
foreach ($terms as $name) {
$str_categories .= "<a href='" . yit_term_link($name) . "'>{$categories[$name]}</a>, ";
}
echo substr($str_categories, 0, strlen($str_categories) - 2);
echo '</p>';
echo '</li>';
}
echo '</ul>';
echo '</div>';
if ($is_slider) {
echo '<div class="controls">';
echo '<a class="next" href="#">Next</a>';
echo '</div>';
}
echo '</div>';
if ($is_slider) {
$script = "<script type=\"text/javascript\">\n \t\t jQuery(document).ready(function(\$){\n \t\t var slider_wrap = \$('.more-projects-widget');\n \t\t var height_item = \$('li', slider_wrap).outerHeight();\n \t\t var height_ul = \$('ul', slider_wrap).height();\n \t\t var height_wrap = \$('.sliderWrap', slider_wrap).height();\n \t\t var n_items = \$('li', slider_wrap).length;\n \t\t var visible = {$project_n_items};\n \t\t\n \t\t \$('.controls, .top', slider_wrap).show();\n \t\t\n \t\t // adjust height, according to visible item\n \t\t \$('.sliderWrap', slider_wrap).css('height', height_item * visible - 6);\n \t\t\n \t\t function check_position() { \n \t\t var margin_top_ul = \$('ul', slider_wrap).css('margin-top');\n \t\t var max_offset = ( n_items - visible ) * height_item * -1;\n \t\t\n \t\t if ( margin_top_ul == '0px' ) {\n \t\t \$('.prev', slider_wrap).addClass('disabled');\n \t\t }\n \t\t\n \t\t if ( margin_top_ul == max_offset+'px' ) {\n \t\t \$('.next', slider_wrap).addClass('disabled');\n \t\t }\n \t\t }\n \t\t\n \t\t check_position();\n \t\t\n \t\t \$('.next:not(.disabled)', slider_wrap).live('click',function(){\n \t\t \$('ul', slider_wrap).animate( {marginTop:'-='+height_item}, {$project_speed_fx}, function(){ check_position(); } );\n \t\t \$('.prev', slider_wrap).removeClass('disabled');\n \t\t return false;\n \t\t });\n \t\t\n \t\t \$('.prev:not(.disabled)', slider_wrap).live('click',function(){\n \t\t \$('ul', slider_wrap).animate( {marginTop:'+='+height_item}, {$project_speed_fx}, function(){ check_position(); } );\n \t\t \$('.next', slider_wrap).removeClass('disabled');\n \t\t return false;\n \t\t });\n \t\t\n \t\t \$('.disabled', slider_wrap).live('click', function(){\n \t\t return false;\n \t\t });\n \t\t });\n \t\t </script>";
echo $script;
}
echo $after_widget;
break;
}
}
}
}
开发者ID:eugenehiggins,项目名称:wellnessrx,代码行数:74,代码来源:more_projects.php
示例4: urlencode
global $post;
$title = urlencode( get_the_title() );
$permalink = urlencode( $post->post_type == 'portfolios' ? yit_work_permalink() : get_permalink() );
$excerpt = urlencode( get_the_excerpt() );
if ( $social == 'facebook' ) {
$url = apply_filters( 'yiw_share_facebook', 'https://www.facebook.com/sharer.php?u=' . $permalink . '&t=' . $title . '' );
} else if ( $social == 'twitter' ) {
$url = apply_filters( 'yiw_share_twitter', 'https://twitter.com/share?url=' . $permalink . '&text=' . $title . '' );
} else if ( $social == 'google' ) {
$url = apply_filters( 'yiw_share_google', 'https://plus.google.com/share?url=' . $permalink . '&title=' . $title . '' );
$attrs = " onclick=\"javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;\"";
} else if ( $social == 'pinterest' ) {
$src = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
$url = apply_filters( 'yiw_share_pinterest', 'http://pinterest.com/pin/create/button/?url=' . $permalink . '&media=' . $src[0] . '&description=' . $excerpt );
$attrs = ' onclick="window.open(this.href); return false;';
} else if ( $social == 'bookmark' ) {
$url = $post->post_type == 'portfolios' ? yit_work_permalink() : get_permalink();
$attrs = ' title="' . urldecode( $title ) . '"';
}
echo do_shortcode( '[social size="small" type="' . $social . '" href="' . $url . '"' . $attrs . ' target="_blank"]' );
echo $script;
}
}
echo '</div>';
开发者ID:simonsays88,项目名称:costa,代码行数:31,代码来源:share.php
示例5: yit_portfolio_get_setting
echo yit_portfolio_get_setting('other_projects_label', $current_portfolio);
?>
</h3>
<div class="portfolio-full-description-related-projects row">
<?php
$portfolios = yit_portfolio_get_setting('items', $current_portfolio);
unset($portfolios[$item_selected]);
?>
<?php
$portfolios = yit_portfolio_get_setting('detail_nitems', $current_portfolio) ? array_slice($portfolios, 0, yit_portfolio_get_setting('detail_nitems', $current_portfolio), true) : $portfolios;
?>
<?php
foreach ($portfolios as $item_id => $item) {
?>
<?php
$post_permalink = yit_work_permalink($item_id);
?>
<div class="<?php
if (++$i % 6 == 0) {
?>
related_project_last <?php
}
?>
related_project span3">
<?php
$item['item_id'] = $item_id;
yit_get_model('portfolio')->_current_item = $item;
$video_url = yit_work_get('video_url');
$image_url = yit_work_get('image_url');
$class = '';
开发者ID:zgomotos,项目名称:Bazar,代码行数:31,代码来源:loop.php
示例6: while
<?php
/**
* Classic Portfolio Section Style
*/
?>
<?php
$count = 0;
while (yit_have_works()) {
$work_terms = yit_work_get('terms');
$work_permalink = yit_work_permalink(yit_work_get('item_id'));
$work_title = yit_work_get('title');
$work_video_url = yit_work_get('video_url');
$work_image_url = yit_work_get('image_url');
// Check for thumbnail or video
$thumb = '';
if (!empty($work_video_url)) {
if ($is_really_video = yit_video_type_by_url($work_video_url)) {
list($work_video_type, $work_video_id) = explode(':', $is_really_video);
}
if (isset($work_video_type)) {
if ($work_video_type == 'youtube') {
$work_video_url = 'http://www.youtube.com/embed/' . $work_video_id . '?width=640&height=480&iframe=true';
} else {
if ($work_video_type == 'vimeo') {
$work_video_url = 'http://player.vimeo.com/video/' . $work_video_id;
}
}
$thumb = $work_video_url;
} else {
开发者ID:jayeshnair,项目名称:ctp,代码行数:31,代码来源:classic.php
示例7: widget
function widget( $args, $instance )
{
extract( $args );
$yit_portfolio = yit_portfolios();
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title'] );
$project_fx = isset( $instance['project_fx']) ? $instance['project_fx'] : false;
$project_easing_fx = isset( $instance['project_easing_fx']) ? $instance['project_easing_fx'] : false;
$project_speed_fx = isset( $instance['project_speed_fx']) ? $instance['project_speed_fx'] : false;
$project_timeout_fx = isset( $instance['project_timeout_fx']) ? $instance['project_timeout_fx'] : false;
$project_n_items = isset( $instance['project_n_items']) ? $instance['project_n_items'] : 5;
$project_post_types = isset( $instance['project_post_type']) ? $instance['project_post_type'] : 'portfolio';
global $more;
$more = 0;
$post_type = $project_post_types;
if( $project_post_types ) {
foreach( $yit_portfolio as $portfolio ) {
if($portfolio->ID == $project_post_types) {
echo $before_widget;
if ( $title ) echo $before_title . $title . $after_title;
echo '<div class="featured-projects-widget flexslider">';
echo '<ul class="slides">';
yit_set_portfolio_loop( $portfolio->ID ); $i = 0;
$categories = yit_portfolio_get_setting( 'categories', $portfolio->ID );
$portfolios = yit_portfolio_get_setting( 'items', $portfolio->ID );
foreach( $portfolios as $item_id => $item ) {
$post_permalink = yit_work_permalink( $item_id );
list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $item_id, 'featured_project_thumb' );
echo '<li>';
echo '<div class="thumb-project">';
echo "<a href='". $post_permalink ."'>";
echo wp_get_attachment_image( $item_id, 'featured_project_thumb' );
echo '</a></div>';
echo '<h4>' . $item['title'] . '</h4>';
echo '</li>';
if( ++$i == $project_n_items ) break;
}
echo '</ul>';
echo '</div>';
$script = "<script type=\"text/javascript\">
jQuery(document).ready(function($){
var animation = $.browser.msie || $.browser.opera ? 'fade' : '$project_fx';
$('.featured-projects-widget').flexslider({
animation: animation,
slideshowSpeed: $project_timeout_fx,
animationSpeed: $project_speed_fx,
selectors: 'ul > li',
directionNav: true,
slideshow: true,
pauseOnAction: false,
controlNav: false,
touch: true
});
});
</script>";
echo $script;
echo $after_widget;
}
}
}
}
开发者ID:simonsays88,项目名称:costa,代码行数:79,代码来源:featured_projects.php
示例8: array
<div class="work-loading"><img class="work-loading" src="<?php echo YIT_THEME_TEMPLATES_URL . '/portfolios/thumbs/images/loading.gif' ?>" alt="loading..." /></div>
</div>
</div>
<!-- portfolio thumbnails -->
<div class="work-projects span3">
<div class="row">
<h2><?php echo $thumbs_title; ?></h2>
<ul>
<?php $works = array(); ?>
<?php while ( yit_have_works() ) : ?>
<?php
$image_id = yit_work_get( 'item_id' );
$works[$image_id] = yit_get_model('portfolio')->_current_item;
$works[$image_id]['categories'] = yit_work_get('categories');
$works[$image_id]['post_permalink'] = yit_work_permalink( $image_id );
$works[$image_id]['thumbs_title'] = yit_work_get( 'thumbs_title' );
$works[$image_id]['project_description_title'] = yit_work_get( 'project_description_title' );
?>
<li class="span1">
<a href="<?php echo $works[$image_id]['post_permalink'] ?>" data-item="<?php echo $image_id ?>">
<?php yit_image( "id=$image_id&size=thumb_small_portfolio_thumbs" );//echo wp_get_attachment_image( $image_id, 'thumb_small_portfolio_thumbs' ); ?>
</a>
</li>
<?php endwhile ?>
</ul>
</div>
</div>
<!-- portfolio content -->
开发者ID:simonsays88,项目名称:costa,代码行数:31,代码来源:markup.php
示例9: array
<?php
/**
* Pinterest Portfolio Section Style
*/
$i = $j = 0;
$portfolio_groups = array();
while (yit_have_works()) {
$portfolio_groups[$i][] = array('title' => yit_work_get('title'), 'terms' => yit_work_get('terms'), 'permalink' => yit_work_permalink(yit_work_get('item_id')), 'image_id' => yit_work_get('item_id'), 'image_url' => yit_work_get('image_url'), 'read_more_text' => yit_work_get('read_more_text'));
if (++$j % 2 == 0) {
$i++;
}
}
?>
<?php
foreach ($portfolio_groups as $k => $group) {
?>
<div class="section_portfolio_group span3 clearfix<?php
if ($k % 4 == 3) {
?>
last_group<?php
}
?>
">
<?php
foreach ($group as $index => $work) {
?>
<?php
$class = '';
if ($k % 2 == 0) {
开发者ID:jayeshnair,项目名称:ctp,代码行数:31,代码来源:pinterest.php
示例10: widget
function widget($args, $instance)
{
$yit_portfolio = yit_portfolios();
extract($args);
$project_n_items = isset($instance['items']) ? $instance['items'] : 6;
$project_post_types = isset($instance['project_post_type']) ? $instance['project_post_type'] : false;
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title']);
global $more;
$more = 0;
if ($project_post_types) {
foreach ($yit_portfolio as $portfolio) {
if ($portfolio->ID == $project_post_types) {
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
$portfolios = yit_portfolio_get_setting('items', $portfolio->ID);
echo '<div class="portfolio-gallery-widget group">';
echo '<ul>';
//loop
yit_set_portfolio_loop($portfolio->ID);
$i = 0;
foreach ($portfolios as $item_id => $item) {
$post_permalink = yit_work_permalink($item_id);
echo '<li class="work-item group">';
echo '<a class="work-thumb" href="' . $post_permalink . '">';
yit_image("id={$item_id}&size=portfolio_gallery_thumb");
echo '</a>';
echo '</li>';
if (++$i == $project_n_items) {
break;
}
}
echo '</ul>';
echo '</div>';
echo $after_widget;
break;
}
}
}
}
开发者ID:jayeshnair,项目名称:ctp,代码行数:42,代码来源:portfolio_gallery.php
示例11: previous_work
/**
* Return the link for the previous project, from the current loop
*
* @since 1.0.0
*/
public function previous_work()
{
if (empty(yit_get_model('cpt_unlimited')->query_vars)) {
return false;
}
$current_item = yit_get_model('cpt_unlimited')->query_vars['item']['item_id'];
$current_portfolio = yit_get_model('cpt_unlimited')->query_vars['post_id'];
$items = $this->_getWorks(array(), $current_portfolio);
$prev_item = false;
$items_values = array_values($items);
$items_keys = array_keys($items);
foreach ($items_values as $id => $item) {
if ($id != 0 && $item['item_id'] == $current_item) {
$prev_item = $items[$items_keys[$id - 1]]['item_id'];
break;
}
}
if ($prev_item === false) {
return;
}
return yit_work_permalink($prev_item);
}
开发者ID:eugenehiggins,项目名称:wellnessrx,代码行数:27,代码来源:Portfolio_type.php
注:本文中的yit_work_permalink函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论