how to use the plugin features in a custom widget?
-
I have a custom widget that uses the functions of the plugin to create a custom carousel.
Everything was working fine but after upgrading to 1.4.0 the resources
target=”<?php echo $link_target; ?>” and href=”<?php echo $carousel_link; ?>”
no longer works.I believe this was due to:
Re-write with Object-oriented programming (OOP)Ha how to solve this?
My code:
<?php
if ( $mumero_de_post == ‘ ‘ ) {
$post_query = ‘post_type=carousel&carousel_category=’.$categoria_escolhida.’&posts_per_page=10′;
} else {
$post_query = ‘post_type=carousel&carousel_category=’.$categoria_escolhida.’&posts_per_page=’ .$mumero_de_post ;
}
?>
<?php query_posts( $post_query ); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post();
$image_size = (isset($options[‘image_size’])) ? $options[‘image_size’] : ‘carousel_slider_home_assinates’;
$img= get_the_post_thumbnail( $post->ID, $image_size );
$carousel_link = get_post_meta( $post->ID, ‘_carousel_slider_slide_link_value’, true );
if (trim($carousel_link) != ”) {
$carousel_link = $carousel_link;
} else {
$carousel_link = ‘#’;
}
$link_target = get_post_meta( $post->ID, ‘_carousel_slider_slide_link_target_value’, true );
?>
<div class=”item” >
” href=”<?php echo $carousel_link; ?>”>
<?php echo $img; ?>
<div class=”descricao-carrosel”>
<?php the_content(); ?>
</div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
- The topic ‘how to use the plugin features in a custom widget?’ is closed to new replies.