Browse Source

Add stiky-post title as ribbon in header

feature/localfonts
fabrixxm 5 years ago
committed by GitHub
parent
commit
d2ccc36af4
  1. 23
      header-home.php

23
header-home.php

@ -41,7 +41,26 @@
<!-- Banner -->
<section id="banner">
<h1><i class="fk-friendica-logo-char" aria-hidden="true"></i> <?php echo esc_html( get_bloginfo( 'name' ) ); ?></h1>
<p><?php echo esc_html(get_bloginfo('description')); ?></p>
<h1>
<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>
</section>

Loading…
Cancel
Save