Cambios en la plantilla

git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_Web/trunk@6 7e4b4a24-fdbc-5948-a674-f6f81f2ee942
This commit is contained in:
David Arranz 2011-12-09 20:32:47 +00:00
parent c3f2ecec66
commit 25a1cbdeb8
9 changed files with 637 additions and 100 deletions

View File

@ -16,13 +16,13 @@
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'dqxjaadh_abetoprueba');
define('DB_NAME', 'abeto');
/** MySQL database username */
define('DB_USER', 'dqxjaadh_abeto');
define('DB_USER', 'usuario');
/** MySQL database password */
define('DB_PASSWORD', 't3t19b4lm');
define('DB_PASSWORD', 'password');
/** MySQL hostname */
define('DB_HOST', 'localhost');
@ -89,5 +89,5 @@ if ( !defined('ABSPATH') )
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
#define('WP_SITEURL', 'http://www.rodax-software.com/abetoprueba');
#define('WP_HOME', 'http://www.rodax-software.com/abetoprueba');
//define('WP_SITEURL', 'http://192.168.0.2/abeto/');
//define('WP_HOME', 'http://192.168.0.2/abeto/');

View File

@ -1,56 +1 @@
<?php
/* Get the author data */
if(get_query_var('author_name')) :
$curauth = get_userdatabylogin(get_query_var('author_name'));
else :
$curauth = get_userdata(get_query_var('author'));
endif;
get_header();
get_template_part('includes/standard_bg');
?>
<div class="ml_wrapper">
<div id="ml_all_content" class="ml_with_sidebar ml_blog">
<section id="ml_archive-info" class="ml_post_content ml_with_padding ml_boxed">
<?php $post = $posts[0]; // hack for the_date(); ?>
<?php
/* Category Archive */
if (is_category()) { ?>
<h1 class="archive-title"><?php printf(__('All posts in "%s"', 'meydjer'), single_cat_title('',false)); ?></h1>
<?php }
/* Tag Archive */
elseif( is_tag() ) { ?>
<h1 class="archive-title"><?php printf(__('All posts tagged "%s"', 'meydjer'), single_tag_title('',false)); ?></h1>
<?php }
/* Day Archive */
elseif (is_day()) { ?>
<h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('F jS, Y'); ?></h1>
<?php }
/* Month Archive */
elseif (is_month()) { ?>
<h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('F, Y'); ?></h1>
<?php }
/* Year Archive */
elseif (is_year()) { ?>
<h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('Y'); ?></h1>
<?php }
/* Author Archive */
elseif (is_author()) { ?>
<h1 class="archive-title"><?php _e('All posts by', 'meydjer') ?> "<?php echo $curauth->display_name; ?>"</h1>
<?php }
/* Other */
elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h1 class="archive-title"><?php _e('Blog Archives', 'meydjer') ?></h1>
<?php } ?>
</section>
<?php get_template_part('includes/loop'); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php /* Get the author data */ if(get_query_var('author_name')) : $curauth = get_userdatabylogin(get_query_var('author_name')); else : $curauth = get_userdata(get_query_var('author')); endif; get_header(); get_template_part('includes/standard_bg'); ?> <div class="ml_wrapper"> <div id="ml_all_content" class="ml_with_sidebar ml_blog"> <section id="ml_archive-info" class="ml_post_content ml_with_padding ml_boxed"> <?php $post = $posts[0]; // hack for the_date(); ?> <?php /* Category Archive */ if (is_category()) { ?> <h1 class="archive-title"><?php printf(__('All posts in "%s"', 'meydjer'), single_cat_title('',false)); ?></h1> <?php } /* Tag Archive */ elseif( is_tag() ) { ?> <h1 class="archive-title"><?php printf(__('All posts tagged "%s"', 'meydjer'), single_tag_title('',false)); ?></h1> <?php } /* Day Archive */ elseif (is_day()) { ?> <h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('F jS, Y'); ?></h1> <?php } /* Month Archive */ elseif (is_month()) { ?> <h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('F, Y'); ?></h1> <?php } /* Year Archive */ elseif (is_year()) { ?> <h1 class="archive-title"><?php _e('Archive for', 'meydjer') ?> <?php the_time('Y'); ?></h1> <?php } /* Author Archive */ elseif (is_author()) { ?> <h1 class="archive-title"><?php _e('All posts by', 'meydjer') ?> "<?php echo $curauth->display_name; ?>"</h1> <?php } /* Other */ elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h1 class="archive-title"><?php _e('Blog Archives', 'meydjer') ?></h1> <?php } ?> </section> <?php get_template_part('includes/loop'); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>

View File

@ -88,6 +88,28 @@ function register_cpt_ml_portfolio() {
}
add_filter('manage_ml_portfolio_posts_columns', 'skill_column' ); //Filter out Post Columns with 2 custom columns
add_action('manage_ml_portfolio_posts_custom_column', 'skill_custom_column', 10, 2);
function skill_column($defaults) {
$defaults['ml_skill'] = __('Skill'); //Language and Films is name of column
return $defaults;
}
function skill_custom_column($column_name, $post_id) {
$taxonomy = $column_name;
$post_type = get_post_type($post_id);
$terms = get_the_terms($post_id, $taxonomy);
if ( !empty($terms) ) {
foreach ( $terms as $term )
$post_terms[] = "<a href='edit.php?post_type={$post_type}&{$taxonomy}={$term->slug}'> " . esc_html(sanitize_term_field('name', $term->name, $term->term_id, $taxonomy, 'edit')) . "</a>";
echo join( ', ', $post_terms );
}
else echo '<i>No terms.</i>';
}
//requires the meta-box script for custom meta fields
require_once ('meta-box.php');

View File

@ -0,0 +1,384 @@
<?php
//get the slides effect options
$latest_n_pictures = of_get_option('ml_latest_n_pictures', '5');
$slides_effect = of_get_option('ml_slides_effect', 'random');
$slides_slices = of_get_option('ml_slides_slices', '4');
$slides_box_cols = of_get_option('ml_slides_box_cols', '4');
$slides_box_rows = of_get_option('ml_slides_box_rows', '4');
$slides_anim_speed = of_get_option('ml_slides_anim_speed', '0.5') * 1000;
$slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
?>
<?php /* filter by skill */ ?>
<?php
global $post;
$skill_id = get_post_meta($post->ID, 'id_skill', true);
?>
<section id="portfolio-categories">
<ul class="ul-portfolio-categories">
<?php /* button to show all the items */ ?>
<li class="selected"><a href="#" data-value="all"><?php _e('All', 'meydjer'); ?></a></li>
<?php /* generate one button per skill */ ?>
<?php
$terms = get_terms('ml_skill', array('parent' => $skill_id, 'hide_empty' => 0));
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo "<li><a href=\"#\">" . $term->name . "</a></li>";
}
}
?>
</ul>
</section><!--END #portfolio-categories-->
<div class="clearfix"></div>
<?php
/* filter portfolio custom post type and show unlimited items */
$args = array('post_type' => 'ml_portfolio',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
'tax_query' => array('taxonomy' => 'ml_skill', 'field' => 'id', 'terms' => $skill_id)
);
query_posts( $args );
?>
<section id="ml_portfolio" class="ml_with_columns">
<div class="ml_centering ml_portfolio_masonry ml_multitple_columns">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'ml_skill' ); // get an array of all the terms as objects.
$terms_slugs = array();
$portfolio_item = '';
foreach( $terms as $term ) {
$portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts
}
$portfolio_item = $portfolio_item . 'portfolio-item';
?>
<?php /* add the skills as classes for each portfolio item */ ?>
<article id="post-<?php the_ID(); ?>" <?php post_class($portfolio_item . ' ml_one_half ml_with_padding ml_boxed ml_visible'); ?>>
<?php
global $post;
//featured preview
$featured_normal = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$featured_normal = $featured_normal[0];
//get the featured image description
$featured_id = get_post_meta($post->ID, '_thumbnail_id', true);
$featured_attachment = get_post($featured_id);
$featured_description = $featured_attachment->post_excerpt == "" ? $featured_attachment->post_content : $featured_attachment->post_excerpt;
//if don't have any description, make it blank
if (!($featured_description)) {
$featured_description = ' ';
}
//Lightbox - YouTube.
if(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_youtube') {
//Video URL
$featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_youtube', true);
?>
<a href="<?php echo $featured_content; ?>" class="featured-image ml_icon_video" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo get_template_directory_uri() . '/includes/timthumb.php?src=' . $featured_content . '&h=234&w=416&zc=1&q=100'; ?>" alt="" width="416" height="234" /></a>
</a>
<?php }
//Lightbox - Vimeo
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_vimeo') {
//Video URL
$featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_vimeo', true);
//Content Poster
$content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100';
?>
<a href="<?php echo $featured_content; ?>" class="featured-image ml_icon_video" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo $content_poster; ?>" alt="" width="416" height="234" /></a>
</a>
<?php }
//Lightbox - QuickTime
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_mov') {
//Video URL
$featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_mov', true)
. '?width='
. get_post_meta($post->ID, 'ml_fc_featured_content_width', true)
. '&height='
. get_post_meta($post->ID, 'ml_fc_featured_content_height', true);
//Content Poster
$content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100';
?>
<a href="<?php echo $featured_content; ?>" class="featured-image ml_icon_video" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo $content_poster; ?>" alt="" width="416" height="234" /></a>
</a>
<?php }
//Lightbox - Flash
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_swf') {
//Video URL
$featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_swf', true)
. '?width='
. get_post_meta($post->ID, 'ml_fc_featured_content_width', true)
. '&height='
. get_post_meta($post->ID, 'ml_fc_featured_content_height', true);
//Content Poster
$content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100';
?>
<a href="<?php echo $featured_content; ?>" class="featured-image ml_icon_video" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo $content_poster; ?>" alt="" width="416" height="234" /></a>
</a>
<?php }
//Lightbox - HTML
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_html') {
$featured_content = '#lightbox_html_'.$post->ID;
//Content Poster
$content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100';
?>
<a href="<?php echo $featured_content; ?>" class="featured-image ml_icon_html" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo $content_poster; ?>" alt="" width="416" height="234" /></a>
</a>
<div id="<?php echo 'lightbox_html_'.$post->ID?>" class="hidden">
<?php echo get_post_meta($post->ID, 'ml_fc_html_content', true); ?>
</div>
<?php }
//Embedded Audio
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'embedded_audio') {
$embedded_audio_mp3 = get_post_meta($post->ID, 'ml_fc_embedded_audio_mp3', true);
$embedded_audio_oga = get_post_meta($post->ID, 'ml_fc_embedded_audio_oga', true);
?>
<div id="jquery_jplayer_<?php echo $post->ID; ?>" class="jp-jplayer"></div>
<div class="jp-audio">
<div class="jp-type-single">
<div id="jp_interface_<?php echo $post->ID; ?>" class="jp-interface">
<ul class="jp-controls play">
<li><a href="#" class="jp-play" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/play_dull.svg.php" alt="Play" /></a></li>
<li><a href="#" class="jp-pause" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/pause_dull.svg.php" alt="Pause" /></a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-controls volume">
<li><a href="#" class="jp-mute" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_on.svg.php" alt="Mute" /></a></li>
<li><a href="#" class="jp-unmute" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_off.svg.php" alt="Unmute" /></a></li>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#jquery_jplayer_<?php echo $post->ID; ?>").jPlayer({
ready: function () {
jQuery(this).jPlayer("setMedia", {
mp3: "<?php echo $embedded_audio_mp3; ?>",
oga: "<?php echo $embedded_audio_oga; ?>"
});
},
swfPath: "<?php echo get_template_directory_uri(); ?>/includes",
cssSelectorAncestor: "#jp_interface_<?php echo $post->ID; ?>",
supplied: "mp3, oga"
});
});
</script>
<?php }
//Embedded - Video
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'embedded_video') {
$embedded_video_m4v = get_post_meta($post->ID, 'ml_fc_embedded_video_m4v', true);
$embedded_video_ogv = get_post_meta($post->ID, 'ml_fc_embedded_video_ogv', true);
$embedded_video_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$embedded_video_height = 'style="height:214px;"';
?>
<div id="jquery_jplayer_<?php echo $post->ID; ?>" class="jp-jplayer jp-jplayer-video" <?php echo$embedded_video_height; ?>></div>
<div class="jp-video">
<div class="jp-type-single">
<div id="jp_interface_<?php echo $post->ID; ?>" class="jp-interface">
<div class="jp-video-play"></div>
<ul class="jp-controls play">
<li><a href="#" class="jp-play" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/play_dull.svg.php" alt="Play" /></a></li>
<li><a href="#" class="jp-pause" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/pause_dull.svg.php" alt="Pause" /></a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-controls volume">
<li><a href="#" class="jp-mute" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_on.svg.php" alt="Mute" /></a></li>
<li><a href="#" class="jp-unmute" tabindex="<?php echo $post->ID; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_off.svg.php" alt="Unmute" /></a></li>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#jquery_jplayer_<?php echo $post->ID; ?>").jPlayer({
ready: function () {
jQuery(this).jPlayer("setMedia", {
m4v: "<?php echo $embedded_video_m4v; ?>",
ogv: "<?php echo $embedded_video_ogv; ?>",
poster: "<?php echo $embedded_video_poster; ?>"
});
},
swfPath: "<?php echo get_template_directory_uri(); ?>/includes",
cssSelectorAncestor: "#jp_interface_<?php echo $post->ID; ?>",
supplied: "m4v, ogv"
});
});
</script>
<?php }
//Embedded - HTML
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'embedded_html') {
$embedded_html_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true);
$embedded_html_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $embedded_html_poster . '&w=416&h=234&zc=1&q=100'
?>
<a href="<?php the_permalink(); ?>" class="featured-image ml_icon_html">
<img src="<?php echo $embedded_html_poster; ?>" alt="HTML" width="416" height="214" />
</a>
<?php }
//Image Slider
elseif(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'slider') { ?>
<div class="ml_nivo-slider">
<?php for ($slide_num = 1; $slide_num <= cte_slide_num; $slide_num++) {
$slide = get_post_meta($post->ID, 'ml_fc_image_slider_'.$slide_num, true);
if($slide) {
$slide = get_template_directory_uri() . '/includes/timthumb.php?src=' . $slide . '&h=416&w=416&zc=1&q=100';
?>
<a href="<?php the_permalink(); ?>">
<img src="<?php echo $slide; ?>" alt="Slide <?php echo $slide_num; ?>" />
</a>
<?php
}
} ?>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.ml_nivo-slider').nivoSlider({
effect:'<?php echo $slides_effect; ?>', // Specify sets like: 'fold,fade,sliceDown'
slices:<?php echo $slides_slices; ?>, // For slice animations
boxCols: <?php echo $slides_box_cols; ?>, // For box animations
boxRows: <?php echo $slides_box_rows; ?>, // For box animations
animSpeed: <?php echo $slides_anim_speed; ?>, // Slide transition speed
pauseTime: <?php echo $slides_pause_time; ?>, // How long each slide will show
startSlide:0, // Set starting Slide (0 index)
directionNav:false, // Next & Prev navigation
directionNavHide:true, // Only show on hover
controlNav:false, // 1,2,3... navigation
controlNavThumbs:false, // Use thumbnails for Control Nav
controlNavThumbsFromRel:false, // Use image rel for thumbs
controlNavThumbsSearch: '.jpg', // Replace this with...
controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
keyboardNav:true, // Use left & right arrows
pauseOnHover:true, // Stop animation while hovering
manualAdvance:false, // Force manual transitions
captionOpacity:0, // Universal caption opacity
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
});
});
</script>
<?php }
//if don't have a featured content, get tue full image URL
else {
//full image URL
$featured_array = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
$featured_image = $featured_array[0];
//add the picture icon to the background of the featured image
$featured_class = 'ml_icon_picture';
//if have featured image, get it and add a content wrapper
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
<a href="<?php echo $featured_image; ?>" class="featured-image ml_icon_picture" data-rel="prettyPhoto[portfolio]" title="<?php echo $featured_description; ?>">
<img src="<?php echo get_template_directory_uri() . '/includes/timthumb.php?src=' . $featured_image . '&h=416&w=416&zc=1&q=100'; ?>" alt="" width="416" height="416" /></a>
</a>
<?php
}
} ?>
<a href="<?php the_permalink(); ?>" class="ml_post-title"><h2 class="post-title portfolio-title"><?php the_title(); ?></h2></a>
<?php /*<p><?php $excerpt = get_the_excerpt(); echo ml_custom_excerpt($excerpt,30); ?></p>*/ ?>
<a href="<?php the_permalink(); ?>" class="button read-more"><?php _e('Read More', 'meydjer'); ?></a>
</article>
<?php endwhile; ?>
</div>
</section>
<!--[if lt IE 9]> <html class="no-js ie6" lang="en">
<script type="text/javascript">
jQuery('.jp-mute').html('<img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_on.gif" alt="Previous Slide" id="prevslide" />');
jQuery('.jp-unmute').html('<img src="<?php echo get_template_directory_uri(); ?>/images/ml_music_off.gif" alt="Previous Slide" id="prevslide" />');
jQuery('.jp-play').html('<img src="<?php echo get_template_directory_uri(); ?>/images/play_dull.gif" alt="Turn On" />');
jQuery('.jp-pause').html('<img src="<?php echo get_template_directory_uri(); ?>/images/pause_dull.gif" alt="Turn Off" />');
</script>
<![endif]-->
<?php else: ?>
<div class="divider"></div><div class="clearfix"></div><!--double line divider-->
<p><?php _e('Sorry, no posts matched your criteria.', 'meydjer') ?></p>
<div class="divider"></div><div class="clearfix"></div><!--double line divider-->
<?php endif; ?>
<?php wp_reset_query(); ?>

View File

@ -1,7 +1,4 @@
<?php
/* filter portfolio custom post type and show unlimited items */
query_posts( 'post_type=ml_portfolio&posts_per_page=-1');
//get the slides effect options
$latest_n_pictures = of_get_option('ml_latest_n_pictures', '5');
$slides_effect = of_get_option('ml_slides_effect', 'random');
@ -10,53 +7,67 @@ $slides_box_cols = of_get_option('ml_slides_box_cols', '4');
$slides_box_rows = of_get_option('ml_slides_box_rows', '4');
$slides_anim_speed = of_get_option('ml_slides_anim_speed', '0.5') * 1000;
$slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
//if slides effect is disables, show only the latest picture
if(!of_get_option('ml_enable_slides_effects')) {
$latest_n_pictures = '1';
}
/* filter pictures custom post type and show unlimited items */
//query_posts( 'post_type=ml_skill&posts_per_page=-1');
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
?>
<?php /* filter by skill */ ?>
<section id="portfolio-categories">
<ul class="ul-portfolio-categories">
<?php /* button to show all the items */ ?>
<li class="selected"><a href="#" data-value="all"><?php _e('All', 'meydjer'); ?></a></li>
<?php /* generate one button per skill */ ?>
<?php
$terms = get_terms('ml_skill');
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo "<li><a href=\"#\">" . $term->name . "</a></li>";
}
}
?>
</ul>
</section><!--END #portfolio-categories-->
<?php
$terms = get_terms('ml_skill', array('parent' => $term->term_id, 'hide_empty' => 1));
$count = count($terms);
if ( $count > 0 ){
?>
<section id="portfolio-categories">
<ul class="ul-portfolio-categories">
<li class="selected"><a href="#" data-value="all"><?php _e('All', 'meydjer'); ?></a></li>
<?php
foreach ( $terms as $term ) {
echo "<li><a href=\"#\">" . $term->name . "</a></li>";
}?>
</ul>
</section>
<?php
}
?>
<div class="clearfix"></div>
<?php
/* filter portfolio custom post type and show unlimited items */
$args = array('post_type' => 'ml_portfolio',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
'tax_query' => array(
array('taxonomy' => 'ml_skill', 'field' => 'slug', 'terms' => $term->slug)
)
);
query_posts( $args );
?>
<section id="ml_portfolio" class="ml_with_columns">
<div class="ml_centering ml_portfolio_masonry ml_multitple_columns">
<div class="ml_centering ml_portfolio_masonry ml_multiple_columns">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'ml_skill' ); // get an array of all the terms as objects.
$terms_slugs = array();
$portfolio_item = '';
foreach( $terms as $term ) {
$portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts
}
$portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts
$portfolio_item = $portfolio_item . 'portfolio-item';
?>
<?php /* add the skills as classes for each portfolio item */ ?>
<article id="post-<?php the_ID(); ?>" <?php post_class($portfolio_item . ' ml_one_half ml_with_padding ml_boxed ml_visible'); ?>>
<?php
global $post;
<?php
//featured preview
$featured_normal = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');

View File

@ -11,7 +11,6 @@ $slides_anim_speed = of_get_option('ml_slides_anim_speed', '0.5') * 1000;
$slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('ml_post_content ml_with_padding ml_boxed'); ?>>
<?php
global $post;
@ -243,7 +242,7 @@ $slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
$slide = get_template_directory_uri() . '/includes/timthumb.php?src=' . $slide . '&h='.$slider_height.'&w=671&zc=1&q=80';
?>
<a href="<?php echo get_post_meta($post->ID, 'ml_fc_image_slider_'.$slide_num, true); ?>" data-rel="prettyPhoto[image_slider]" title="<?php echo $caption; ?>">
<img src="<?php echo $slide; ?>" alt="<?php echo $title; ?>" rel="<?php echo $slide_thumb; ?>" />
<img src="<?php echo $slide; ?>" alt="<?php echo $title; ?>" title="<?php echo $title; ?>" rel="<?php echo $slide_thumb; ?>" />
</a>
<?php
}
@ -269,9 +268,9 @@ $slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
keyboardNav:true, // Use left & right arrows
pauseOnHover:true, // Stop animation while hovering
manualAdvance:false, // Force manual transitions
captionOpacity:0, // Universal caption opacity
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
captionOpacity:0.7, // Universal caption opacity
prevText: 'Anterior', // Prev directionNav text
nextText: 'Siguiente', // Next directionNav text
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown

View File

@ -0,0 +1,152 @@
<?php
//get the slides effect options
$latest_n_pictures = of_get_option('ml_latest_n_pictures', '5');
$slides_effect = of_get_option('ml_slides_effect', 'random');
$slides_slices = of_get_option('ml_slides_slices', '4');
$slides_box_cols = of_get_option('ml_slides_box_cols', '4');
$slides_box_rows = of_get_option('ml_slides_box_rows', '4');
$slides_anim_speed = of_get_option('ml_slides_anim_speed', '0.5') * 1000;
$slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000;
//if slides effect is disables, show only the latest picture
if(!of_get_option('ml_enable_slides_effects')) {
$latest_n_pictures = '1';
}
/* filter pictures custom post type and show unlimited items */
//query_posts( 'post_type=ml_skill&posts_per_page=-1');
global $post;
$skill_id = get_post_meta($post->ID, 'id_skill', true);
?>
<section id="ml_galleries" class="ml_with_columns">
<div class="ml_centering ml_galleries_masonry ml_multitple_columns">
<?php /* filter by gallery */ ?>
<?php /* generate a box for each gallery */ ?>
<?php
$terms = get_terms('ml_skill',
array( 'parent' => $skill_id,
'hide_empty' => 0,
'orderby' => 'title',
'order' => 'ASC'
)
);
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) { ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('ml_one_half ml_with_padding ml_boxed'); ?>>
<div class="ml_masonry_prevent">
<?php /* generate the slider filtering by the current skill */ ?>
<div class="ml_nivo-slider">
<?php
$args = array(
'post_type' => 'ml_portfolio',
'posts_per_page' => $latest_n_pictures,
'tax_query' => array(
array(
'taxonomy' => 'ml_skill',
'field' => 'slug',
'terms' => $term->slug
)
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
//full image URL
$featured_array = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
$featured_image = $featured_array[0];
//add the picture icon to the background of the featured image
$featured_class = 'ml_icon_picture';
//if have featured image, get it and add a content wrapper
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) {
if ($loop->found_posts == 1) {?>
<a href="<?php the_permalink(); ?>" class="ml_nivo-slider-link">
<?php } else { ?>
<a href="<?php echo get_term_link($term->slug, 'ml_skill'); ?>" class="ml_nivo-slider-link">
<?php } ?>
<img src="<?php echo get_template_directory_uri() . '/includes/timthumb.php?src=' . $featured_image . '&h=416&w=416&zc=1&q=100'; ?>" alt="" width="416" height="416" /></a>
</a>
<?php } else {
if(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'slider') {
for ($slide_num = 1; $slide_num <= cte_slide_num; $slide_num++) {
$slide = get_post_meta($post->ID, 'ml_fc_image_slider_'.$slide_num, true);
if($slide) {
$slide = get_template_directory_uri() . '/includes/timthumb.php?src=' . $slide . '&h=416&w=416&zc=1&q=100';
if ($loop->found_posts == 1) {?>
<a href="<?php the_permalink(); ?>">
<?php } else { ?>
<a href="<?php echo get_term_link($term->slug, 'ml_skill'); ?>">
<?php } ?>
<img src="<?php echo $slide; ?>" alt="Slide <?php echo $slide_num; ?>" />
</a>
<?php
}
} //for
} // if
} // else
endwhile; ?>
</div>
</div>
<?php /* call the nivo slider script, with custom options */ ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.ml_nivo-slider').nivoSlider({
effect:'<?php echo $slides_effect; ?>', // Specify sets like: 'fold,fade,sliceDown'
slices:<?php echo $slides_slices; ?>, // For slice animations
boxCols: <?php echo $slides_box_cols; ?>, // For box animations
boxRows: <?php echo $slides_box_rows; ?>, // For box animations
animSpeed: <?php echo $slides_anim_speed; ?>, // Slide transition speed
pauseTime: <?php echo $slides_pause_time; ?>, // How long each slide will show
startSlide:0, // Set starting Slide (0 index)
directionNav:false, // Next & Prev navigation
directionNavHide:true, // Only show on hover
controlNav:false, // 1,2,3... navigation
controlNavThumbs:false, // Use thumbnails for Control Nav
controlNavThumbsFromRel:false, // Use image rel for thumbs
controlNavThumbsSearch: '.jpg', // Replace this with...
controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
keyboardNav:true, // Use left & right arrows
pauseOnHover:true, // Stop animation while hovering
manualAdvance:false, // Force manual transitions
captionOpacity:0, // Universal caption opacity
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
});
});
</script>
<?php
if ($loop->found_posts == 1) {?>
<a href="<?php the_permalink(); ?>" class="ml_post-title"><h2 class="post-title gallery-title"><?php echo $term->name; ?></h2></a>
<p><?php echo ml_custom_excerpt($term->description,30); ?></p>
<a href="<?php the_permalink(); ?>" class="button read-more"><?php _e('View'); ?></a>
<?php
} else {
?>
<a href="<?php echo get_term_link($term->slug, 'ml_skill'); ?>" class="ml_post-title"><h2 class="post-title gallery-title"><?php echo $term->name; ?></h2></a>
<p><?php echo ml_custom_excerpt($term->description,30); ?></p>
<a href="<?php echo get_term_link($term->slug, 'ml_skill'); ?>" class="button read-more"><?php _e('View'); ?></a>
<?php } ?>
</article>
<?php }
}
?>
</div>
</section>
<?php wp_reset_query(); ?>

View File

@ -0,0 +1,10 @@
<?php
get_header();
get_template_part('includes/standard_bg');
?>
<div class="ml_wrapper">
<div id="ml_all_content" class="ml_with_no_sidebar">
<?php get_template_part('includes/loop-portfolio-2cols'); ?>
</div>
<?php get_template_part('includes/minimize'); ?>
<?php get_footer(); ?>

View File

@ -0,0 +1,14 @@
<?php
/*
Template Name: Skill - 2 Cols
*/
get_header();
get_template_part('includes/standard_bg');
?>
<div class="ml_wrapper">
<div id="ml_all_content" class="ml_with_no_sidebar">
<?php get_template_part('includes/loop-skill-2cols'); ?>
</div>
<?php get_template_part('includes/minimize'); ?>
<?php get_footer(); ?>