コード例 #1
0
function customize_output($results, $arg, $id, $getdata)
{
    // The Query
    $apiclass = new uwpqsfprocess();
    $query = new WP_Query($arg);
    ob_start();
    $result = '';
    // The Loop
    if ($query->have_posts()) {
        while ($query->have_posts()) {
            $query->the_post();
            global $post;
            $type = get_post_type();
            if (get_post_meta(get_the_ID(), '_post_extra_boxes_checkbox', true) != 'on') {
                blokmaker(4, $type);
            }
        }
        echo $apiclass->ajax_pagination($arg['paged'], $query->max_num_pages, 4, $id, $getdata);
    } else {
        echo '<div class="col-md-12"><h2 style="margin-top:0;">Nothing found</h2></div>';
    }
    /* Restore original Post Data */
    wp_reset_postdata();
    $results = ob_get_clean();
    return $results;
}
コード例 #2
0
function doc_filter_customize_output($results, $arg, $id, $getdata)
{
    // The Query
    $apiclass = new uwpqsfprocess();
    $query = new WP_Query($arg);
    ob_start();
    $result = '';
    if ($query->have_posts()) {
        while ($query->have_posts()) {
            $query->the_post();
            global $post;
            $pdf = rwmb_meta('business_pdf');
            $link = rwmb_meta('business_link');
            $postid = get_the_ID();
            ?>
<div class="document-row group">
					 <div class="list nine columns">
						 <a href="<?php 
            the_permalink();
            ?>
" class="h3 title" title="<?php 
            echo get_the_title();
            ?>
">
							 <?php 
            echo get_the_title();
            ?>
					 </a>
						 <p> <?php 
            the_excerpt();
            ?>
</p>
					 </div>

				<div class="more one columns">
					<a href="<?php 
            the_permalink();
            ?>
" class="button full"><i class="fa fa-arrow-circle-right">
							</i>Read More</a>
				</div>
			<div class="pdf one columns">
				<?php 
            if (!$pdf == '') {
                echo '<a href="' . $pdf . '" class="button red">
						<i class="fa fa-file-pdf-o fa-inverse"></i>
						</a>';
            } else {
                ?>
<span class="button red inactive"><i class="fa fa-file-pdf-o fa-inverse"></i></span><?php 
            }
            ?>
			</div>
		</div>
		<?php 
        }
        echo $apiclass->ajax_pagination($arg['paged'], $query->max_num_pages, 4, $id, $getdata);
    } else {
        echo 'Sorry, there are no results matching your search.';
    }
    /* Restore original Post Data */
    wp_reset_postdata();
    $results = ob_get_clean();
    return $results;
}
コード例 #3
0
ファイル: functions.php プロジェクト: brianotoole/mjpaa
function customize_output($results , $arg, $id, $getdata ){
	 // The Query
            $apiclass = new uwpqsfprocess();
            $query = new WP_Query( $arg ); ?>
	<div class="results-total">
		<?php  
			$numberOfQueries = $query->found_posts;
			
			if ($numberOfQueries == 1) {?>
				<h5><?php echo $numberOfQueries; ?> result found:</h5>
				
			<?}elseif ($numberOfQueries == 0){?>
				<h5>No results found. <a class="clear-results" value="Refresh Page" onClick="window.location.reload()" href="" title="Click to Selected Class Filtering Options">Click here to clear / reset options.</a></h5>
			    <a class="button transparent border" href="<?php bloginfo('url'); ?>/classes/help">Need Help Finding a Class?</a>
				
			<?}else{?>
				<h5><?php echo $numberOfQueries; ?> results found:</h5>
			<?}
		?> 
		
	</div>

<?php	ob_start();	$result = '';
	// The Loop
		if ( $query->have_posts() ) {
			while ( $query->have_posts() ) {
				$query->the_post();
			$thumb_id = get_post_thumbnail_id();
			$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
			$thumb_url = $thumb_url_array[0];
			
			?>
			  <a href="<?php the_permalink() ?>">
				<div class="col-sm-4">
				  <?php if (has_post_thumbnail( $post->ID ) ): //if featured image is uploaded... ?>
				  <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); $image = $image[0]; ?>
				  <img class="thumbnail" src="<?php echo $image; ?>">
				  <?php else: //if no featured image is uploaded, show default icon img ?>
				  <div class="thumbnail default"><i class="fa fa-music"></i></div>
				  <?php endif; ?>
				</div><!--/.col-->
				<div class="col-sm-8 descrip">
				  <h3 class="class-title"><?php the_title(); ?></h3>
				  <?php if( get_field('class_start_date') ): ?>
				  <p class="date"><?php the_field('class_start_date'); ?> - <?php the_field('class_end_date'); ?></p>  
				  <?php else: //is "post" not "class" ?>
				  <p class="date"><span class="cat-title"><?php global $post; $category = get_the_category($post->ID); echo $category[0]->name; ?></span>
				  <?php endif; ?>
				  <p><?php mjpaa_excerpt('mjpaa_excerpt_length','mjpaa_view_more_class'); ?></p>
				</div><!--/.col-->
			  </a>
				<div class="clear"></div><hr />
	<?}
                        echo  $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id, $getdata);
		 } else {
					 echo  '';
				}
				/* Restore original Post Data */
				wp_reset_postdata();
		$results = ob_get_clean();		
			return $results;
}