Ejemplo n.º 1
0
function ayo_pinsdash_welcome()
{
    //  http://www.drewgreenwell.com/projects/metrojs#fiddleAround
    ?>

<!---->
<script type="text/javascript">
	/* Hide default welcome message */
	jQuery(document).ready( function($)
	{
			//	$('div.welcome-panel-content').hide();
	});
</script>
<!---->
	<div class="custom-welcome-panel-content">
<!---->
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
<br><br>
  <script>
/////////////// highlight pin-uri
  $(function() {
  //  $( "#sortable" ).sortable();
//	$('#sortable').sortable().bind('sortupdate', function() {
    //Triggered when the user stopped sorting and the DOM position has changed.
});
//    $( "#sortable" ).disableSelection();
  //  $( "#sortable" ).sortable({  placeholder: "ui-state-highlight"});
//$( "#sortable" ).draggable({ cursor: "crosshair", cursorAt: { top: 56, left: 56 } });


////////////////////////////////////
$('#btn_pindel').click(function() {
  // removes all LI with class="cls" in OL
  $('ul li.ui-state-default').remove();
});


  });

  addAnother = function() {
      var ul = this.document.getElementById("sortable");
      var li = this.document.createElement("li")//.show( "fold", 1000 );
      var children = ul.children.length + 1
      li.setAttribute("id", "ui-state-default"+children);//.show( "fold", 1000 );
      li.appendChild(document.createTextNode("Pin "+ children));// + document.innerHTML(<a href="link/to/trash/script/when/we/have/js/off" title="Delete this image" class="ui-icon ui-icon-trash">Delete image</a>));
      ul.appendChild(li)
  }

  </script>
</head>
<body>

<ul id="sortable">
<?

///////////// show pinned products
$args = array(
	'post_type'      => 'product',
	'post_status'    => 'pin_featured',
	'orderby'        => 'date',
	'order'          => 'DESC',
	'meta_query' => array(
			array(
					'key' => '_is_featured',
					'value' => 'yes'
			)
	) ,
	'posts_per_page' => 30

                        );

$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) {

	while ( $my_query->have_posts() ) {
		$my_query->the_post();

echo "<li class='ui-state-default'> ";
	//// <li class="ui-state-default">Pin-4</li>
    echo "<div class='btn_pin_status'>PRODUCT</div>";
	//  echo "<div class='btn_pin_title'>" . the_titlesmall('', '...', true, '20')  . '<br /></div>';
?><div class='btn_pin_title'><? the_titlesmall('', '', true, '20') ?> <br></div><?
		echo"<div class='btn_pin_all'><div class='btn_pin_edit'><a href='/wp-admin/post.php?post=" . get_the_ID() . "&action=edit'><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/edit.png'  . "'></div>";
		echo "</a><br>";
		echo"<div class='btn_pin_view'><a href=\"" . get_permalink() . "\"><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/view.png'  . "'></a></div>";

		echo "</div></li>";

	}

};
wp_reset_postdata();

///////////// show pinned posts

if ( $new_status !== 'trash' ) {
			// Do something when post is deleted
			$args = array(
				'post_type'      => 'post',
				'post_status'    => 'pin_featured',
				'orderby'        => 'date',
				'order'          => 'DESC',
				'meta_query' => array(
						array(
								'key' => '_is_featured',
								'value' => 'no'
						)
				) ,
				'posts_per_page' => 30

			                        );

			$my_query = new WP_Query( $args );
 }
///////////////////////////////////
$args = array(
	'post_type'      => 'post',
	'post_status'    => 'pin_featured',
	'orderby'        => 'date',
	'order'          => 'DESC',
	'meta_query' => array(
			array(
					'key' => '_is_featured',
					'value' => 'yes'
			)
	) ,
	'posts_per_page' => 30

                        );

$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) {

	while ( $my_query->have_posts() ) {
		$my_query->the_post();

echo "<li class='ui-state-default'> ";
	//// <li class="ui-state-default">Pin-4</li>
		echo "<div class='btn_pin_status'>POST   <a href='#'>XXX</a></div>";
	//	echo "<div class='btn_pin_title'>". the_titlesmall('', '', true, '20') . '<br /></div>';
		?><div class='btn_pin_title'><?  the_titlesmall('', '', true, '20')  ?> <br /></div><?
		echo"<div class='btn_pin_all'><div class='btn_pin_edit'><a href='/wp-admin/post.php?post=" . get_the_ID() . "&action=edit'><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/edit.png'  . "'></div>";
		echo "</a><br>";
		echo"<div class='btn_pin_view'><a href=\"" . get_permalink() . "\"><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/view.png'  . "'></a></div>";


?>
<script>
function deletepin(){
	function setCurrent(obj){
$('li#ui-state-default li a').each(function(){
    $('.current').removeClass('current');
});
$(obj).addClass('current');
}

}
</script>

<?
	echo "</div></li>";
	}

}
wp_reset_postdata();


///////////////////////////// SHOW PINNED Pages
$args = array(
	'post_type'      => 'page',
	'post_status'    => 'pin_featured',
	'orderby'        => 'date',
	'order'          => 'DESC',
	'meta_query' => array(
			array(
					'key' => '_is_featured',
					'value' => 'yes'
			)
	) ,
	'posts_per_page' => 30

                        );

$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) {

	while ( $my_query->have_posts() ) {
		$my_query->the_post();

echo "<li class='ui-state-default'>";
	//// <li class="ui-state-default">Pin-4</li>

  	echo "<div class='btn_pin_status'>PAGE</div>";
	//	echo "<div class='btn_pin_title'>" . the_titlesmall('', '', true, '20') . '<br /></div>';
		?><div class='btn_pin_title'><?  the_titlesmall('', '', true, '20')  ?> <br /></div><?
		echo"<div class='btn_pin_all'><div class='btn_pin_edit'><a href='/wp-admin/post.php?post=" . get_the_ID() . "&action=edit'><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/edit.png'  . "'></div>";
		echo "</a><br>";
		echo"<div class='btn_pin_view'><a href=\"" . get_permalink() . "\"><img src='" . plugin_dir_url( dirname( __FILE__ ) ) . 'img/view.png'  . "'></a></div>";

		echo "</div></li>";

	}

}
wp_reset_postdata();
?>

</ul>
<!--<button class="btn" onClick="addAnother()"> Adsuga </button>-->
</body>

</div>

<?php 
    //////////////////////////////////////////
    /*
    $args = array(
    	'post_type'      => 'post',
    	'post_status'    => 'featured',
    	'orderby'        => 'date',
    	'order'          => 'DESC',
    	'meta_query' => array(
    			array(
    					'key' => '_is_featured',
    					'value' => 'yes'
    			)
    	) ,
    	'posts_per_page' => 30
    
                            );
    
    $my_query = new WP_Query( $args );
    if ( $my_query->have_posts() ) {
    
    	while ( $my_query->have_posts() ) {
    		$my_query->the_post();
    
    echo "<li class='ui-state-default'> <a href=\"edit.php?&post_status=featured&post_type=post\"> <!--<a href=\"" . get_permalink() . "\">-->";
    	//// <li class="ui-state-default">Pin-4</li>
    		echo get_the_title() . '<br />';
    		echo "</a>";
    		echo "</li>";
    
    	}
    
    }
    wp_reset_postdata();
    ///////////////////////////////////////////////////////*/
}
			<?php 
// Post thumbnail.
twentyfifteen_post_thumbnail();
?>
			<a class="moretag hide-on-small-only" href="<?php 
echo get_permalink($post->ID);
?>
"> <?php 
the_title('<span class="card-title">', '</span>');
?>
			</a>
			<a class="moretag hide-on-med-and-up" href="<?php 
echo get_permalink($post->ID);
?>
"><span class="card-title"> <?php 
the_titlesmall('', '...', true, '40');
?>
</span>
			</a>
		</header>
		<!-- .entry-header -->
		<!-- .entry-content -->
		<?php 
edit_post_link(__('Edit', 'twentyfifteen'), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->');
?>

	</div>
</article>


<!-- #post-## -->
Ejemplo n.º 3
0
        } else {
            ?>
                                                    <?php 
            inkthemes_get_image(270, 345);
            ?>
 
                                                    <?php 
        }
        ?>
                                            </div>
                                            <div class="flex_content"> 
                                                <h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_titlesmall('', '...', true, '35');
        ?>
</a></h3>
                                                <?php 
        echo inkthemes_custom_trim_excerpt(40);
        ?>
                                                <a class="read_more" href="<?php 
        the_permalink();
        ?>
"><?php 
        _e('Continue Reading &rarr;', 'colorway');
        ?>
</a>				
                                            </div>
                                        </li>
                                        <?php 
Ejemplo n.º 4
0
    function widget($args, $instance)
    {
        global $post;
        extract(array('title' => '', 'number_posts' => 5, 'theme' => 'post_nothumbnailed', 'post_order' => 'latest', 'post_type' => 'post'));
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $post_count = 5;
        if (isset($instance['number_posts'])) {
            $post_count = $instance['number_posts'];
        }
        $q['posts_per_page'] = $post_count;
        $cats = (array) $instance['post_category'];
        $q['paged'] = 1;
        $q['post_type'] = $instance['post_type'];
        if (count($cats) > 0) {
            $typ = 'category';
            if ($instance['post_type'] != 'post') {
                $typ = 'catalog';
            }
            $catq = '';
            $sp = '';
            foreach ($cats as $mycat) {
                $catq = $catq . $sp . $mycat;
                $sp = ',';
            }
            $catq = explode(',', $catq);
            $q['tax_query'] = array(array('taxonomy' => $typ, 'terms' => $catq, 'field' => 'id'));
        }
        if ($instance['post_order'] == 'commented') {
            $current = -1;
        }
        $featuredCurrent = 0;
        query_posts($q);
        if (isset($before_widget)) {
            echo $before_widget;
        }
        if ($title != '') {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        echo '<div class="jw-recent-posts-widget">';
        echo '<ul>';
        while (have_posts()) {
            the_post();
            if ($instance['post_order'] == 'commented') {
                $featured_post = get_post_meta($post->ID, 'featured_post', true);
                if ($featured_post == "1") {
                    ?>
				<li class="widget-ad-list ad-box featurads-widget">

											
					<?php 
                    require_once TEMPLATEPATH . '/inc/BFI_Thumb.php';
                    ?>

						<?php 
                    $thumb_id = get_post_thumbnail_id();
                    $thumb_url = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
                    $params = array('width' => 300, 'height' => 250, 'crop' => true);
                    echo "<img alt='image' class='widget-ad-image' src='" . bfi_thumb("{$thumb_url['0']}", $params) . "'/>";
                    ?>
						
						<div class="ad-hover-content">
						<a href="<?php 
                    the_permalink();
                    ?>
" style="padding:125px 18px">						
						<?php 
                    $post_price = get_post_meta($post->ID, 'post_price', true);
                    ?>
						<span class="add-price"><?php 
                    echo $post_price;
                    ?>
</span>
							</a>
						</div>
						

				</li>
			<?php 
                }
            } else {
                ?>
			<li class="widget-ad-list latestads-widget">

									
				<?php 
                require_once TEMPLATEPATH . '/inc/BFI_Thumb.php';
                ?>

				<?php 
                $thumb_id = get_post_thumbnail_id();
                $thumb_url = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
                $params = array('width' => 80, 'height' => 80, 'crop' => true);
                echo "<img alt='image' class='widget-ad-image' src='" . bfi_thumb("{$thumb_url['0']}", $params) . "'/>";
                ?>

					<div class="widget-ad-list-content">

					<span class="widget-ad-list-content-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_titlesmall('', '...', true, '20');
                ?>
</a></span>

					<?php 
                $post_price = get_post_meta($post->ID, 'post_price', true);
                ?>
					<p class="add-price"><?php 
                echo $post_price;
                ?>
</p>
					<?php 
                the_excerpt(custom_excerpt_length('10'));
                ?>

					</div>

			</li>
			<?php 
            }
        }
        echo '</ul>';
        echo '</div>';
        if (isset($after_widget)) {
            echo $after_widget;
        }
        wp_reset_query();
    }