forked from friendica/friendica-wp-theme
Add stiky-post title as ribbon in header
This commit is contained in:
parent
9449051285
commit
d2ccc36af4
1 changed files with 21 additions and 2 deletions
|
@ -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…
Reference in a new issue