mirror of
https://github.com/cupcakearmy/liquet.git
synced 2024-12-22 16:16:25 +00:00
support for widgets
This commit is contained in:
parent
cf0ecb26a0
commit
efa3a25d9c
@ -14,6 +14,19 @@ add_action( 'wp_enqueue_scripts', function () {
|
||||
wp_enqueue_style( 'fonts', get_template_directory_uri() . '/vendor/fonts/import.css' );
|
||||
} );
|
||||
|
||||
add_action( 'widgets_init', function () {
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => 'Below posts',
|
||||
'id' => 'below_posts',
|
||||
'before_widget' => '<div class="widget">',
|
||||
'after_widget' => '</div>',
|
||||
'before_title' => '<h3 class="alt-font">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
} );
|
||||
|
||||
|
||||
add_action( 'admin_init', function () {
|
||||
add_settings_section( 'section-link', 'Links', null, 'theme-options' );
|
||||
|
@ -22,13 +22,20 @@ $dates = getDates();
|
||||
<div class="alt-font">previous</div>
|
||||
</a>
|
||||
|
||||
<div class="flex item grow" id="main">
|
||||
<div class="flex item grow container vertical middle" id="main">
|
||||
|
||||
<!-- Title -->
|
||||
<div class="flex container vertical middle">
|
||||
<div class="box" id="header">
|
||||
<h1 class="alt-font"><?= the_title() ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content Body -->
|
||||
<div class="flex container vertical middle" id="content">
|
||||
|
||||
<!-- Reading time and date -->
|
||||
<?php if ( is_singular( 'post' ) ) : ?>
|
||||
<div class="flex container horizontal">
|
||||
<div>
|
||||
<b><?= $dates['created'] ?></b>
|
||||
@ -44,14 +51,35 @@ $dates = getDates();
|
||||
</div>
|
||||
</div>
|
||||
<br><br>
|
||||
<?php the_content(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Content -->
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
<div class="flex container vertical middle">
|
||||
|
||||
<!-- Tags -->
|
||||
<?php if ( is_singular( 'post' ) ) : ?>
|
||||
<div class="auto-width text-align-center">
|
||||
<br>
|
||||
<?php render_current_tags(); ?>
|
||||
<br>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Links -->
|
||||
<div class="flex container vertical middle auto-width">
|
||||
<?php render_links( true ); ?>
|
||||
</div>
|
||||
|
||||
<!-- Bottom Widgets -->
|
||||
<?php if ( is_singular( 'post' ) ) : ?>
|
||||
<?php if ( is_active_sidebar( 'below_posts' ) ) : ?>
|
||||
<br><br><br><br><br><br>
|
||||
<div class="auto-width widget-area text-align-center">
|
||||
<?php dynamic_sidebar( 'below_posts' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<a class="flex item shrink links" href="<?= getNextURL( true ) ?>">
|
||||
|
@ -69,6 +69,10 @@ hr {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.text-align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#app {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
@ -108,3 +112,8 @@ img.icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.auto-width {
|
||||
max-width: var(--text-width);
|
||||
width: 100%;
|
||||
}
|
Loading…
Reference in New Issue
Block a user