Hallo,
hat sich durch das Update auf WP 4.4.1 das Datumsformat geändert - also die Formatierung des Datums im "Hintergrund" bzw. Script?
Ich habe vor einigen Jahren ein dreckiges Script geschrieben, weil ich in einem speziellen Theme unterschiedliche Darstellungen für sogenannte "Projects" brauchte. Seit dem Update auf 4.4.1 (und einem Umzug zu einem anderen Server) funktioniert es nicht mehr. In einer bisher nicht aktualisierten Version 4.2.1 funktioniert allerdings noch alles einwandfrei (auf dem alten Server).
Das hier ist das Script - es geht um die if-Abfrage von Zeile 19 bis 40 (bzw. bis Zeile 59) | ab dem "<?php":
<?php get_header(); ?>
<div id="pageHead">
<h1><?php the_title(); ?></h1>
<div class="projectNav clearfix">
<div class="next <?php if(!get_next_post()){ echo 'inactive'; }?>">
<?php next_post_link('%link', true); ?>
</div>
<div class="previous <?php if(!get_previous_post()){ echo 'inactive'; }?>">
<?php previous_post_link('%link', true); ?>
</div>
</div> <!-- end navigation -->
</div>
<?php
$date1 = "2014-01-01"; //Januar 1, 2014
$date2 = $post->post_date;
if ($date1 > $date2){?>
<div id="content" class="threeFourth clearfix">
<?php while (have_posts()) : the_post(); ?>
<div class="project clearfix">
<?php the_content(); ?>
<?php $project_url = get_post_meta($post->ID, "_ttrust_url_value", true); ?>
<?php $project_url_label = get_post_meta($post->ID, "_ttrust_url_label_value", true); ?>
<?php $project_url_label = ($project_url_label!="") ? $project_url_label : __('Visit Site', 'themetrust'); ?>
<?php if ($project_url) : ?>
<p><a class="action" href="<?php echo $project_url; ?>"><?php echo $project_url_label; ?></a></p>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div>
<?php get_sidebar(); ?>
<? } else { ?>
<div id="content" class="full">
<?php while (have_posts()) : the_post(); ?>
<div class="project clearfix">
<?php the_content(); ?>
<?php $project_url = get_post_meta($post->ID, "_ttrust_url_value", true); ?>
<?php $project_url_label = get_post_meta($post->ID, "_ttrust_url_label_value", true); ?>
<?php $project_url_label = ($project_url_label!="") ? $project_url_label : __('Visit Site', 'themetrust'); ?>
<?php if ($project_url) : ?>
<p><a class="action" href="<?php echo $project_url; ?>"><?php echo $project_url_label; ?></a></p>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div>
<?php } ?>
<?php get_footer(); ?>
Alles anzeigen
Es werden einfach immer beide Parts untereinander angezeigt, als wäre da gar keine if-Abfrage.
Könnt ihr mir erklären, woran es liegen könnte?