Add stiky-post title as ribbon in header

This commit is contained in:
fabrixxm 2017-06-06 14:22:33 +02:00 committed by GitHub
parent 9449051285
commit d2ccc36af4

View file

@ -41,7 +41,26 @@
<!-- Banner --> <!-- Banner -->
<section id="banner"> <section id="banner">
<h1><i class="fk-friendica-logo-char" aria-hidden="true"></i> <?php echo esc_html( get_bloginfo( 'name' ) ); ?></h1> <h1>
<p><?php echo esc_html(get_bloginfo('description')); ?></p> <span>
<i class="fk-friendica-logo-char" aria-hidden="true"></i> <?php echo esc_html( get_bloginfo( 'name' ) ); ?>
<?php
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 1,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
$query = new WP_Query( $args );
if ( isset($sticky[0]) ) {
$query->the_post();
echo "<a href='" . get_the_permalink() . "' class='ribbon'>";
echo get_the_title();
echo "</a>";
wp_reset_postdata();
}
?>
</span>
</h1> <p><?php echo esc_html(get_bloginfo('description')); ?></p>
<p><a href="https://github.com/friendica/friendica/releases" class="button special">Download</a> <a href="http://dir.friendica.social/servers" class="button">Try It</a></p> <p><a href="https://github.com/friendica/friendica/releases" class="button special">Download</a> <a href="http://dir.friendica.social/servers" class="button">Try It</a></p>
</section> </section>