loadmore on events page
This commit is contained in:
@@ -4,85 +4,9 @@
|
||||
<!-- section -->
|
||||
<section>
|
||||
|
||||
<?php if (have_posts()): while (have_posts()): the_post();?>
|
||||
|
||||
<?php
|
||||
$event_datum = get_post_meta( get_the_ID(), 'dis-esemeny-datum', true );
|
||||
$event_link = get_post_meta( get_the_ID(), 'dis-esemeny-link', true );
|
||||
?>
|
||||
|
||||
|
||||
<article id="post-<?php the_ID();?>" <?php post_class();?>>
|
||||
|
||||
<!-- post thumbnail -->
|
||||
<?php if (has_post_thumbnail()): // Check if thumbnail exists ?>
|
||||
<a class="thumbnailwrapper" href="<?php echo $event_link; ?>" title="<?php the_title();?>" target="_blank">
|
||||
<?php the_post_thumbnail('home-event-thumbnail');?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<!-- /post thumbnail -->
|
||||
|
||||
<div class="event-metadata">
|
||||
|
||||
|
||||
<div class="top-row">
|
||||
<div class="ev-date">
|
||||
<?php
|
||||
echo preg_replace('/^(\d{4}\.)(\d{2}\.)(\d{2}\.)$/','\1</br>\2 \3',$event_datum );
|
||||
// echo $event_datum;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Arrow -->
|
||||
<a href="<?php echo $event_link; ?>" target="_blank" class="arrow-link">
|
||||
→
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="hr">
|
||||
|
||||
</div>
|
||||
<div class="bottom-row">
|
||||
<!-- title -->
|
||||
<h2>
|
||||
<a href="<?php echo $event_link; ?>" target="_blank"><?php the_title();?></a>
|
||||
|
||||
</h2>
|
||||
<div class="vr"></div>
|
||||
<!-- Tovább button -->
|
||||
<a href="<?php echo $event_link; ?>" class="text-link" target="_blank">Tovább az eseményre</a>
|
||||
</div>
|
||||
|
||||
</div><!-- end event-metadata -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- post title -->
|
||||
|
||||
<!-- /post title -->
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
<?php endwhile;?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<!-- article -->
|
||||
<article>
|
||||
<h2><?php _e('Sorry, nothing to display.', 'dis2019');?></h2>
|
||||
</article>
|
||||
<!-- /article -->
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php include locate_template('loop-esemeny.php', false, false);?>
|
||||
|
||||
<?php get_template_part('loadmore');?>
|
||||
|
||||
</section>
|
||||
<!-- /section -->
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -480,7 +480,12 @@ function misha_loadmore_ajax_handler()
|
||||
$args['offset'] = $offset + (($_POST['page'] - 1) * $ppp);
|
||||
|
||||
query_posts($args);
|
||||
get_template_part('loop');
|
||||
|
||||
if (($args[category_name] == get_theme_mod('dis-2019-event-cat-slug', 'esemeny'))) {
|
||||
get_template_part('loop-esemeny');
|
||||
}else{
|
||||
get_template_part('loop');
|
||||
}
|
||||
|
||||
die; // here we exit the script and even no wp_reset_query() required!
|
||||
}
|
||||
|
||||
77
loop-esemeny.php
Normal file
77
loop-esemeny.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php if (have_posts()): while (have_posts()): the_post();?>
|
||||
|
||||
<?php
|
||||
$event_datum = get_post_meta( get_the_ID(), 'dis-esemeny-datum', true );
|
||||
$event_link = get_post_meta( get_the_ID(), 'dis-esemeny-link', true );
|
||||
?>
|
||||
|
||||
|
||||
<article id="post-<?php the_ID();?>" <?php post_class();?>>
|
||||
|
||||
<!-- post thumbnail -->
|
||||
<?php if (has_post_thumbnail()): // Check if thumbnail exists ?>
|
||||
<a class="thumbnailwrapper" href="<?php echo $event_link; ?>" title="<?php the_title();?>" target="_blank">
|
||||
<?php the_post_thumbnail('home-event-thumbnail');?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<!-- /post thumbnail -->
|
||||
|
||||
<div class="event-metadata">
|
||||
|
||||
|
||||
<div class="top-row">
|
||||
<div class="ev-date">
|
||||
<?php
|
||||
echo preg_replace('/^(\d{4}\.)(\d{2}\.)(\d{2}\.)$/','\1</br>\2 \3',$event_datum );
|
||||
// echo $event_datum;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Arrow -->
|
||||
<a href="<?php echo $event_link; ?>" target="_blank" class="arrow-link">
|
||||
→
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="hr">
|
||||
|
||||
</div>
|
||||
<div class="bottom-row">
|
||||
<!-- title -->
|
||||
<h2>
|
||||
<a href="<?php echo $event_link; ?>" target="_blank"><?php the_title();?></a>
|
||||
|
||||
</h2>
|
||||
<div class="vr"></div>
|
||||
<!-- Tovább button -->
|
||||
<a href="<?php echo $event_link; ?>" class="text-link" target="_blank">Tovább az eseményre</a>
|
||||
</div>
|
||||
|
||||
</div><!-- end event-metadata -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- post title -->
|
||||
|
||||
<!-- /post title -->
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
<?php endwhile;?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<!-- article -->
|
||||
<article>
|
||||
<h2><?php _e('Sorry, nothing to display.', 'dis2019');?></h2>
|
||||
</article>
|
||||
<!-- /article -->
|
||||
|
||||
<?php endif;?>
|
||||
@@ -1677,7 +1677,7 @@ body.category.category-esemeny {
|
||||
height: 85vw;
|
||||
max-height: calc(50vw + 180px);
|
||||
.thumbnailwrapper {
|
||||
height: 50vw;
|
||||
// height: 50vw;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -1827,6 +1827,13 @@ body.category.category-esemeny {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------- loadmore on desktop on events --------------------- */
|
||||
|
||||
.misha_loadmore{
|
||||
width: calc(50vw - #{$h-unit-4} - #{$h-unit-2});
|
||||
max-width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user