function wpc_elementor_shortcode( $atts ) {
?>
<div class="owl-menu owl-carousel custom-owl-carousel owl-theme">
<?php
global $post;
$myposts = get_posts([
'numberposts' => 100,
'category' => 5,
]);
$ir = 0;
?>
<?php foreach( $myposts as $post ) :
setup_postdata( $post );
?>
<?php if ($ir % 2 == 0) : ?>
<div class="item-slider">
<?php endif; ?>
<div class="item-menu">
<p>Статьи / <?php the_date(); ?></p>
<h3><?php the_title(); ?></h3>
<p><?php the_excerpt( '' ); ?></p>
<a class="box-post_link" href="<?php echo get_permalink(); ?>">Читать дальше </a>
</div>
<?php if ($ir % 2 !== 0) : ?>
</div>
<?php endif; $ir++; ?>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
</div>
<?php
}
add_shortcode( 'my_elementor_php_output', 'wpc_elementor_shortcode');
var $page = $('html, body');
$('a[href*="#form"]').click(function() {
$page.animate({
scrollTop: $($.attr(this, 'href')).offset().top-200
}, 800);
return false;
});
$("#form").on("click","a", function (event) {
event.preventDefault();
var id = $(this).attr('href'),
top = $(id).offset().top;
top = top + ($(window).height() - $(id).height());
$('body,html').animate({scrollTop: top}, 1500);
});