Skip to content

Commit

Permalink
Capa melhor preparada para publicações semanais
Browse files Browse the repository at this point in the history
* Move ícone do feed RSS/Atom do menu em texto para o dos ícones
(`header.php`).
* Acrescenta blocos do plugin Shortcoder à capa (`index.php`):
 1) aviso de conteúdos novos às sextas-feiras no topo; e 2) newsletters
do diretório no meio dos posts.
* Exibe datas apenas uma vez por dia na capa (`the_date();` em
`template-parts/content.php`) e remove datas dos posts individuais,
 mantendo-as dentro dos posts.
* Adiciona função/condicional `shortcode_exists()` onde precisava.
* Corrige datas e permalinks dos resultados da pesquisa
(`template-parts/content-search.php`).
  • Loading branch information
rghedin committed Jun 19, 2024
1 parent 8b777fd commit c7d93ba
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 66 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

if ( ! defined( '_S_VERSION' ) ) {
define( '_S_VERSION', '3.2.3.1' );
define( '_S_VERSION', '3.3' );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<!-- Text Navigation -->
<ul id="primary-menu" class="menu nav-menu link-alt">
<li class="menu-item"><a href="/acompanhe/">Newsletter</a></li>
<li class="menu-item"><a href="/feed/"><img src="/wp-content/themes/dez/img/icone-rss-outline.svg" alt="Feed RSS" width="26" height="26" /></a></li>
<li class="menu-item"><a href="/sobre/">Sobre</a></li>
<li class="menu-item"><a href="/orbita/">Órbita</a></li>
<li class="menu-item"><a href="/apoie/"><strong>Apoie</strong></a></li>
Expand Down Expand Up @@ -115,6 +114,9 @@
// Mode.
$icon_nav .= '<a id="dark-mode-toggle" name="dark-mode-toggle" alt="Alternar Tema (Claro ou Escuro)" title="Alternar Tema (Claro ou Escuro)" onClick="setDezTheme(event)"></a>';

// Feed RSS/Atom
$icon_nav .= '<a href="/feed/"><img src="/wp-content/themes/dez/img/icone-rss-outline.svg" alt="Feed RSS" width="26" height="26" /></a>';

$icon_nav .= '<div id="secondary-menu" class="menu-item">';

// User Navigation.
Expand Down
20 changes: 9 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@
get_header();
?>

<?php echo do_shortcode( '[sc name="sextas-feiras"][/sc]' ); ?>

<main id="primary" class="site-main">

<?php
$count = 0;
if ( have_posts() ) :

if ( is_home() && ! is_front_page() ) :
?>
<header>
<h1 class="page-title"><?php single_post_title(); ?></h1>
</header>
<?php
endif;

/* Start the Loop */
while ( have_posts() ) :
the_post();

Expand All @@ -39,14 +32,19 @@
?>
<div class="orbita-manual">
<h2>Destaques do Órbita</h2>
<?php echo do_shortcode( '[orbita-ranking comment-points="1" vote-points="3" days="10" limit="5"]' ); ?>
<?php if ( shortcode_exists( 'orbita-ranking' ) ) {
echo do_shortcode( '[orbita-ranking comment-points="1" vote-points="3" days="10" limit="5"]' );
} ?>
<footer class="entry-footer link-alt">
<a href="/orbita/">Todas as conversas &raquo;</a>
</footer>
</div>
</div>
<?php
endif;

elseif ( 5 == $count && shortcode_exists( 'sc' ) ) :
echo do_shortcode( '[sc name="buttondown-newsletters"][/sc]' );
endif;

$count++;

Expand Down
19 changes: 10 additions & 9 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: featured-images, threaded-comments
Requires at least: 4.5
Tested up to: 8.1.12
Requires PHP: 5.6
Stable tag: 3.2.4
Stable tag: 3.3
License: GNU General Public License v2 or later
License URI: LICENSE

Expand Down Expand Up @@ -43,16 +43,17 @@ Dez includes support for WooCommerce and for Infinite Scroll in Jetpack.

== Changelog ==

= 3.2.4 - Jun 7 2024 =
* Altera leiaute dos blocos `ctx-`, prevê uso de `label` para sinalizar o
tipo de bloco (ajuda na acessibilidade) e nova classe genérica `ctx`, mas
manté as classes antigas para retrocompatibilidade.
* Acrescenta bordas ao menu principal (`ul.nav-menu`) e botão do menu do
leitor (`.menu-toggle-icon`)
= 3.3 - Jun 19 2024 =
* Acrescenta blocos do plugin Shortcoder à capa (`index.php`): 1) aviso de conteúdos novos às sextas-feiras no topo; e 2) newsletters do diretório no meio dos posts
* Exibe datas apenas uma vez por dia na capa (`the_date();` em `template-parts/content.php`) e remove datas dos posts individuais, mantendo-as dentro dos posts
* Adiciona função/condicional `shortcode_exists()` onde precisava
* Corrige datas e permalinks dos resultados da pesquisa (`template-parts/content-search.php`)
* Altera leiaute dos blocos `ctx-`, prevê uso de `label` para sinalizar o tipo de bloco (ajuda na acessibilidade) e nova classe genérica `ctx`, mas mantém as classes antigas para retrocompatibilidade.
* Acrescenta bordas ao menu principal (`ul.nav-menu`) e botão do menu do leitor (`.menu-toggle-icon`)
* Move ícone do feed RSS/Atom do menu em texto para o dos ícones (`header.php`)
* Inverte posições dos links de responder e curtir comentários
* Bloqueia o carregamento do arquivo `jlad-frontend.css`, do plugin Just Likes
and Dislikes, no front-end (via `functions.php`)
* Ajustes no `style.css` para o plugin Just Likes and Dislikes
* Bloqueia o carregamento do arquivo `jlad-frontend.css`, do plugin Just Likes and Dislikes, no front-end (via `functions.php`)

= 3.2.3 - Jun 7 2024 =
* Restabelece o carregamento do jQuery no front-end, bloqueando o jQuery Migrate
Expand Down
75 changes: 41 additions & 34 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://manualdousuario.net/
Author: Rodrigo Ghedin
Author URI: https://rodrigo.ghed.in/
Description: Manual do Usuário Theme
Version: 3.2.4
Version: 3.3
Tested up to: 8.1.12
Requires PHP: 5.6
License: GNU General Public License v2 or later
Expand Down Expand Up @@ -371,7 +371,7 @@ ul.nav-menu {
background-color: var(--cor-destaques);
border: 1px solid var(--cor-bordas);
border-radius: var(--med-borda);
width: 340px;
width: 300px;
height: 42px;
}

Expand All @@ -391,12 +391,25 @@ ul.nav-menu {
filter: invert();
}

.sextas-feiras {
margin-bottom: var(--med-salto-grande);
width: fit-content;
margin-inline: auto;
text-align: center;
font-family: var(--ff-monospace);
font-size: var(--fs-0);
color: var(--cor-link-meta);
}
.home .sextas-feiras {
margin-top: -4rem;
}

/* Corpo
--------------------------------------------- */

.hfeed article.hentry,
.hfeed .orbita-manual {
margin: 1rem 0 var(--med-salto-grande);
margin: 0 0 var(--med-salto-grande);
}

article.hentry p:last-child,
Expand All @@ -406,6 +419,15 @@ article.hentry li:last-child {
margin-bottom: 0;
}

.data {
margin: 0 0 var(--med-salto-medio);
font-family: var(--ff-monospace);
font-size: var(--fs-0);
}
.data:first-letter {
text-transform: capitalize;
}

/* Post
--------------------------------------------- */

Expand Down Expand Up @@ -790,7 +812,7 @@ ol.children {
}

#search-container input[type="search"].search-field {
width: 340px;
width: 300px;
height: 42px;
padding-right: 0;
}
Expand Down Expand Up @@ -942,28 +964,12 @@ span.required-field-message,

/* Just Like Dislikes
--------------------------------------------- */
.jlad-like-dislike-wrap {
display: block;
margin-bottom: 0;
float: left;
.jlad-like-dislike-wrap.jlad-custom {
line-height: 1;
}

.jlad-like-dislike-wrap .jlad-common-wrap,
.jlad-count-wrap {
margin: 0;
}

.jlad-common-wrap {
min-width: 80px;
}

.jlad-common-wrap > a.jlad-like-dislike-trigger {
text-decoration: none;
}

.jlad-like-dislike-wrap.jlad-custom img {
max-width: 20px;
max-width: 18px;
display: initial;
vertical-align: middle;
}
Expand Down Expand Up @@ -1250,6 +1256,7 @@ table.dataTable-table tr:nth-child(even) {
@media (max-width: 710px) {
.site-header {
row-gap: var(--med-salto-pequeno);
margin-bottom: var(--med-salto-medio);
}
.icons-navigation {
order: 2;
Expand All @@ -1264,21 +1271,22 @@ table.dataTable-table tr:nth-child(even) {
padding: .5rem 1rem;
}

.format-quote .entry-title {
font-size: var(--fs-2) !important;
.sextas-feiras {
margin: var(--med-salto-medio) auto;
}
.format-quote .entry-content p:first-child {
margin-left: 0;
.home .sextas-feiras {
margin-top: initial;
}

.ctx-parceiros {
padding: 1rem .5rem .5rem;
.data {
margin-bottom: var(--med-salto-pequeno);
}
.ctx-parceiros label {
left: initial;

.format-quote .entry-title {
font-size: var(--fs-2) !important;
}
.ctx-parceiros img {
margin-right: .5rem;
.format-quote .entry-content p:first-child {
margin-left: 0;
}

.lyte-wrapper,
Expand Down Expand Up @@ -1331,8 +1339,7 @@ table.dataTable-table tr:nth-child(even) {
border-radius: 0;
padding: .25rem .5rem;
}
.comment-content,
.jlad-like-dislike-wrap {
.comment-content {
margin-left: .5rem;
}

Expand Down
4 changes: 2 additions & 2 deletions style.min.css

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<div class="entry-meta link-alt">
<?php the_time( 'j/n/y, G\hi' ); ?>
<?php
if ( has_post_format( array('aside', 'image', 'link', 'quote') ) ) :
echo get_the_time( 'j/n/y, ');
echo '<a href="'. esc_url( get_permalink() ) .'" rel="bookmark" class="link-alt">';
echo get_the_time( 'G\hi' );
echo '</a>';
else :
echo get_the_time( 'j/n/y, G\hi' );
endif ?>
<?php if ( comments_open() || get_comments_number() ) :
echo '&middot;&nbsp;';
comments_popup_link( '<span>0</span>', '<span>1</span>', '<span>%</span>', 'comment-link link-alt', '' );
Expand Down
15 changes: 8 additions & 7 deletions template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@

?>

<?php if ( is_home() ) :
the_date('l, j\/n\/Y', '<p class="data">', '</p>');
endif; ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<div class="entry-meta link-alt">
<?php
if ( has_post_format( array('aside', 'image', 'link', 'quote') ) ) :
echo get_the_time( 'j/n/y, ');
echo '<a href="'. esc_url( get_permalink() ) .'" rel="bookmark" class="link-alt">';
echo get_the_time( 'G\hi' );
echo '</a>';
elseif ( ! is_page() ) :
if ( has_post_format( array('aside', 'image', 'link', 'quote') ) && is_home() ) :
echo '<a href="'. esc_url( get_permalink() ) .'" rel="bookmark" class="link-alt">&#35;</a>&nbsp;&middot;';
elseif ( is_single() && ! is_page() ) :
echo get_the_time( 'j/n/y, G\hi' );
echo '&nbsp;&middot;';
endif ?>

<?php if ( comments_open() || get_comments_number() ) :
echo '&middot;&nbsp;';
comments_popup_link( '<span>0</span>', '<span>1</span>', '<span>%</span>', 'comment-link link-alt', '' );
endif; ?>
<?php if ( ( 'post' || 'podcast' === get_post_type() ) && ( ! in_category( array( 'post-livre', 'patrocinios' ) ) && ! has_tag( array( 'como-eu-trabalho', 'na-mochila', 'escritorio-em-casa' ) ) ) ) : ?>
Expand Down

0 comments on commit c7d93ba

Please sign in to comment.