3v4l.org

run code in 300+ PHP versions simultaneously
<?php if( get_post_type( get_the_ID() ) == 'presse'): ?> <?php $id = get_the_ID(); $title = get_the_title($id); $meta = get_post_meta($id,'Presse-News', true); $pdfID = $meta[0]['presse-pdf']; $pdfURL = wp_get_attachment_url( $pdfID ); ?> <div class="row"> <div class="col-md-12"> <div class="panel-group" id="accordion<?php echo $id; ?>"> <div class="panel panel-default accordion"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" href="#collapse<?php echo $id; ?>" class="collapsed"> <?php echo '<span>' . get_the_time( 'd.m.Y', $id ) . '</span> - ' . $title; ?> </a> </h4> </div> <div id="collapse<?php echo $id ?>" class="panel-collapse collapse" style="height: 0;"> <div class="panel-body"> <?php echo the_content(); ?> <br> <a href="<?php echo $pdfURL?>" target="_blank">Den gesamten Artikel als PDF downloaden</a> </div> </div> </div> </div> </div> </div> <?php elseif( get_post_type( get_the_ID() ) == 'marktanalysen'): ?> <?php $id = get_the_ID(); $title = get_the_title($id); // $meta = get_post_meta($id,'Presse-News', true); // $pdfID = $meta[0]['presse-pdf']; // $pdfURL = wp_get_attachment_url( $pdfID ); ?> <div class="row"> <div class="col-md-12"> <div class="panel-group" id="accordion<?php echo $id; ?>"> <div class="panel panel-default accordion"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" href="#collapse<?php echo $id; ?>" class="collapsed"> <?php echo '<span>' . get_the_time( 'd.m.Y', $id ) . '</span> - ' . $title; ?> </a> </h4> </div> <div id="collapse<?php echo $id ?>" class="panel-collapse collapse" style="height: 0;"> <div class="panel-body"> <?php echo the_content(); ?> <br> <a href="<?php //echo $pdfURL?>" target="_blank">Den gesamten Artikel als PDF downloaden</a> </div> </div> </div> </div> </div> </div> <?php else: ?> <div class="row"> <?php if (ct_get_option("posts_index_show_image", 1) && has_post_thumbnail(get_the_ID())): ?> <div class="col-md-5"> <div class="media-object"> <a href="<?php echo get_permalink(get_the_ID()) ?>"><?php get_template_part('templates/post/content-featured-image'); ?></a> </div> </div> <div class="col-md-7"> <?php else: ?> <div class="col-md-12"> <?php endif ?> <h4 class="uppercase"><a href="<?php echo get_permalink(get_the_ID()) ?>"><?php echo ct_get_blog_item_title() ?></a></h4> <?php get_template_part('templates/post/content-meta'); ?> <?php if (ct_get_option("posts_index_show_excerpt", 1) && get_the_content()): ?> <p><?php echo ct_get_excerpt_by_id(get_the_id()); ?></p> <?php endif ?> <?php if (ct_get_option("posts_index_show_fulltext", 0)): ?> <?php the_content(); ?> <?php endif ?> <?php if (ct_get_option("posts_index_show_tags", 0) && has_tag()): ?> <?php the_tags('<span class="meta"> <span class="meta-single uppercase"><i class="fa fa-tags"></i> ', ', ', '</span></span>') ?> <?php endif; ?> <?php if (ct_get_option("posts_index_show_excerpt", 1)): ?> <a href="<?php echo get_permalink(get_the_ID()) ?>" class="btn btn-lg btn-border">mehr lesen</a> <?php endif ?> </div> </div> <?php endif; ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function get_post_type() in /in/mqYrg:1 Stack trace: #0 {main} thrown in /in/mqYrg on line 1
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function get_post_type() in /in/mqYrg on line 1
Process exited with code 255.

preferences:
175.42 ms | 402 KiB | 182 Q