我有一个名为 Jobs ( https://www.bap.cc/jobs/ ) 的 Wordpress 页面。在那里我想显示两种不同的帖子类型(Jobs 和 Jobsangbote)。
一切正常,除了我的 php.ini 中的活动功能。第一个块“Wirsuchen”没问题,“Wir bieten”活动功能不起作用。不知道为什么...
<?php
get_header(); ?>
<div class="overflow-y ios blur"><article class="article barba- container"><div id="agenturtext" class="text overflow firefox">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
echo '<header>';
the_title('<h1 id="agenturheader">','</h1>');
echo '</header>';
the_content();
// Include the page content template.
//get_template_part( 'content', 'page' );
// End the loop.
endwhile;
?>
</div>
<div id="float" class="overflow jobs firefox">
<div class="agenturbild">
<?php
$id=get_the_ID();
$thumbnail_id=get_post_thumbnail_id($id);
$tablet=wp_get_attachment_image_src($thumbnail_id, 'tablet')[0];
$srcset=wp_get_attachment_image_srcset($thumbnail_id);
$alt=get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true );
echo '<img src="' . $tablet . '" srcset="' . $srcset . '" alt="' . ($alt?$alt:' ') . '" class="lazyload"></div>' /*sizes="(max-width: 920px) 33vw, (max-width: 1200px) 50vw, (max-width: 1500px) 60vw, (max-width:2000px) 70vw, 80vw"*/; ?>
<div id="jobmenu">
<?php $args = array( 'post_type' => 'jobs', 'posts_per_page' => -1, 'orderby'=>'date', 'order'=>'DESC' );
$loop = new WP_Query( $args );
$a=0;
if ($loop->found_posts>1){
echo '
<div class="jobueberschrift"><h2 class="jobtitel">Wir suchen:</h2></div>';
$ID=get_the_ID();
while ( $loop->have_posts() ) : $loop->the_post();
echo '<div><a href="' . get_the_permalink() . '" class="joblink' . (get_the_ID()===$ID?' jobactive':'') . '">';the_title('<h2>','</h2>');echo '</a></div>';
// Include the page content template.
get_template_part( 'content', 'page' );
// End the loop.
endwhile;
}
wp_reset_query();
?>
<?php $argsangebote = array( 'post_type' => 'jobsangebote', 'posts_per_page' => -1, 'orderby'=>'date', 'order'=>'DESC' );
$loop = new WP_Query( $argssangebote );
$a=0;
if ($loop->found_posts>1){
echo '
<div class="jobueberschrift" style="margin-top:52px !important;"> <h2 class="jobtitel">Wir bieten:</h2></div>';
$ID=get_the_ID();
while ( $loop->have_posts() ) : $loop->the_post();
echo '<div><a href="' . get_the_permalink() . '" class="joblink' . (get_the_ID()===$ID?' jobactive':'') . '">';the_title('<h2>','</h2>');echo '</a></div>';
// Include the page content template.
get_template_part( 'content', 'page' );
// End the loop.
endwhile;
}
?>
</div>
</article></div>
<?php get_footer(); ?>