Compare commits

...

25 commits
v1.0.0 ... main

Author SHA1 Message Date
e08ba95a38 💄 Muestra botón de scroll hacia arriba siempre 2025-06-28 07:33:38 +02:00
585a95fac3 Revierte previsualización de contenidos 2025-06-28 07:25:19 +02:00
ca2a0b3190 💄 Añade icono para enlazar a SoloGit 2025-06-21 18:11:44 +02:00
1239e8f935 🩹 Corrige la visualización de las citas 2025-06-21 10:51:03 +02:00
537e4b0b2b 💄 Recupera icono para enlazar a Mastodon 2025-03-03 16:12:31 +01:00
13d5e0581a 💄 Añade icono para enlazar a Bluesky 2024-12-16 01:22:11 +01:00
5820b34f31 💄 Añade icono para enlazar a Mastodon 2022-11-23 20:15:33 +01:00
b61354a7e2 📝 Libera la versión 1.1.1 2022-08-28 20:31:07 +02:00
01bf525ff6 Actualiza visualización de "Entradas del blog" 2022-08-28 11:32:45 +02:00
5266f4a317 Corrige la vista de las citas
Se posiciona correctamente el nombre del autor cuando la cita se muestra
en página individual. También se aumenta el contraste de color en el
listado de "Otras citas".
2022-02-06 19:23:58 +01:00
1932537e7e Actualiza estilos para las notas y los snippets
El "Archivo de notas" y los "Marcadores" se han integrado en un único
bloque llamado "Notas rápidas". Y para los snippets se han descargado
las versiones más recientes de Prismjs del plugin Highlighting Code
Block. Se ajustan los estilos para tener en cuenta estos cambios.
2022-02-06 18:47:25 +01:00
d375f803ac Retoca la versión para impresora de la página web 2021-09-09 22:56:38 +02:00
0944f895db Retoca los estilos de la página de inicio 2021-09-09 20:12:18 +02:00
d9dff1fc67 Añade estilos para aumentar texto de botones
Los botones grandes mantenían el tamaño de la fuente. Se añaden estilos
para aumentar este tamaño. También se mejora la visualización del botón
cuando se pasa el ratón por encima, porque aparecía una distorsión de un
par de píxeles justo debajo del botón.
2021-08-05 05:21:27 +02:00
461e40c45f Añade estilos a los bloques de la página de inicio
De la fila de widgets con contenidos del sitio, tres requieren un enlace
a su correspondiente página principal. Se sustituye el título de estos
bloques por botones de ancho completo que imitarán el aspecto del título
usando estos estilos.
2021-08-04 22:20:49 +02:00
2394be9383 Añade nueva página de inicio y mejoras de estilo 2021-08-03 21:05:18 +02:00
6f9b7ff421 Retoca tamaño de fuente en los enlaces al imprimir 2020-10-30 13:13:20 +01:00
0a14c61f5a Mejora la vista de impresión de enlaces e imágenes
Se destacan y se muestran los enlaces en la página, se desactivan las
animaciones para visualizar mejor los componentes que se pueden
imprimir, especialmente las imágenes, y se ajusta la página "Sobre mí".
2020-10-29 18:24:18 +01:00
bee661f3c4 Mejora la presentación de impresión
Se añaden nuevos estilos para simplificar la presentación de las páginas
para imprimir. Se eliminan elementos supérfluos y colores de fondo
oscuros.

Resuelve #489
2020-10-26 21:18:16 +01:00
516b5f4413 Actualiza listas y resaltado de sintaxis código
Detalle:
  - Se revisan las listas y se crea una nueva plantilla sólo para
    páginas recientes.
  - Se sustituye el plugin de resaltado de sintaxis por otro que usa
    Prism.js y se integra bien con Enfold. Se ajustan estilos.
  - Se actualizan algunos estilos básicos.
2020-07-20 21:01:47 +02:00
29d3a19129 Elimina la visualización de datos EXIF en fotos
Se desinstala el plugin "Exifography" y se elimina la función
add_exif_data() porque ya no se van a mostrar los datos EXIF de las
imágenes del álbum de fotos al instalarse el plugin "ShortPixel Image
Optimizer" que los elimina para mejorar la tasa de compresión.
2020-05-27 19:35:57 +02:00
ec0ac6e671 Añade estilos para plugin de tablas de contenido 2020-05-07 20:26:03 +02:00
996c8b3354 Añade ayuda para las imágenes al crear entradas 2020-05-07 20:25:28 +02:00
bcb8953a07 Modifica denominación de Apuntes por Notas breves 2020-05-07 20:23:09 +02:00
f6a7c540a3 Añade archivo README 2020-04-19 12:23:01 +02:00
14 changed files with 1114 additions and 204 deletions

8
README.md Normal file
View file

@ -0,0 +1,8 @@
# manuel.cillero.es
Código específico, hojas de estilo, recursos y *snippets* del **tema hijo**
basado en Enfold Theme (https://kriesi.at/themes/enfold-overview) desarrollado
para mi sitio personal (https://manuel.cillero.es) creado con WordPress
(https://es.wordpress.org).
Versión 1.1.1

View file

@ -0,0 +1,51 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
// Block direct requests
if ( !defined('ABSPATH') )
die('-1');
echo $before_widget;
if ( !empty($title) )
echo $before_title . $title . $after_title;
if( $flexible_posts->have_posts() ):
?>
<ul class="dpe-flexible-posts list-archive-notes">
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php echo the_permalink(); ?>">
<?php
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
}
?>
<h4 class="title<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_title(); ?></h4>
<p class="meta<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
</ul><!-- .dpe-flexible-posts -->
<?php else: // We have no posts ?>
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -24,19 +24,19 @@ if( $flexible_posts->have_posts() ):
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php echo the_permalink(); ?>">
<?php
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
<?php
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php echo 'desde '; the_time('F \d\e Y'); ?></p>
}
?>
<h4 class="title<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_title(); ?></h4>
<p class="meta<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php echo 'desde '; the_time('F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
@ -45,7 +45,7 @@ if( $flexible_posts->have_posts() ):
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -24,10 +24,10 @@ if( $flexible_posts->have_posts() ):
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
@ -38,8 +38,8 @@ if( $flexible_posts->have_posts() ):
}
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
<h4 class="title<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_title(); ?></h4>
<p class="meta<?php if( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
@ -48,7 +48,7 @@ if( $flexible_posts->have_posts() ):
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -24,10 +24,10 @@ if( $flexible_posts->have_posts() ):
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
@ -38,8 +38,8 @@ if( $flexible_posts->have_posts() ):
}
}
?>
<h4 class="title"><?php the_title(); ?></h4>
<p class="meta"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
<h4 class="title<?php if ( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_title(); ?></h4>
<p class="meta<?php if ( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_time('\d\e\l d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
@ -48,7 +48,7 @@ if( $flexible_posts->have_posts() ):
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -0,0 +1,54 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
// Block direct requests
if ( !defined('ABSPATH') )
die('-1');
echo $before_widget;
if ( !empty($title) )
echo $before_title . $title . $after_title;
if( $flexible_posts->have_posts() ):
?>
<ul class="dpe-flexible-posts list-pages">
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
global $wp;
$permalink = get_permalink();
$current_url = home_url( add_query_arg( array(), $wp->request ) );
echo '<a href="' . $permalink . ( trim( $permalink, '/' ) == $current_url ? '" class="active">' : '">' );
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
}
?>
<h4 class="title<?php if ( $thumbnail ) echo ' with_thumbnail'; ?>"><?php the_title(); ?></h4>
<p class="meta<?php if ( $thumbnail ) echo ' with_thumbnail'; ?>"><?php echo 'del '; the_modified_time('d \d\e F \d\e Y'); ?></p>
</a>
</li>
<?php endwhile; ?>
</ul><!-- .dpe-flexible-posts -->
<?php else: // We have no posts ?>
<div class="dpe-flexible-posts no-posts">
<p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
</div>
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -1,11 +1,11 @@
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
@ -23,38 +23,38 @@ if( $flexible_posts->have_posts() ):
<ul class="dpe-flexible-posts">
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ($post->post_type == 'quote') {
$quote_text = get_the_content();
$author = wp_get_post_terms($post->ID, 'quote_author_tag', array("fields" => "all"));
$quote_author = '<p>— <a href="/quotes/author/' . $author[0]->slug . '">' . $author[0]->name . '</a></p>';
} else {
$quote_text = get_the_content();
$quote_author = get_the_title();
$provider = wp_get_post_terms($post->ID, 'quote_provider_tag', array("fields" => "all"));
switch ($provider[0]->name) {
case 'Proverbia.net':
$quote_text = mb_convert_encoding($quote_text, 'ISO-8859-15', 'UTF-8');
$quote_author = mb_convert_encoding(substr($quote_author, 0, strpos($quote_author, ' &#8211; ')), 'ISO-8859-15', 'UTF-8');
$quote_provider = '<a href="http://es.proverbia.net" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'BrainyQuote':
$quote_provider = '<a href="http://www.brainyquote.com" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'The Quotations Page':
$quote_provider = '<a href="http://www.quotationspage.com" target="_blank">' . $provider[0]->name . '</a>';
}
$quote_text = '<p>' . trim($quote_text, '"') . '</p>';
$quote_author = '<p>— ' . $quote_author . ' (' . $quote_provider . ')</p>';
}
echo '<div class="quote-text">' . $quote_text . '</div>';
echo '<div class="quote-author">' . $quote_author . '</div>';
?>
<?php
if ($post->post_type == 'quote') {
$quote_text = get_the_content();
$author = wp_get_post_terms($post->ID, 'quote_author_tag', array("fields" => "all"));
$quote_author = '<p>— <a href="/quotes/author/' . $author[0]->slug . '">' . $author[0]->name . '</a></p>';
} else {
$quote_text = get_the_content();
$quote_author = get_the_title();
$provider = wp_get_post_terms($post->ID, 'quote_provider_tag', array("fields" => "all"));
switch ($provider[0]->name) {
case 'Proverbia.net':
$quote_text = mb_convert_encoding($quote_text, 'ISO-8859-15', 'UTF-8');
$quote_author = mb_convert_encoding(substr($quote_author, 0, strpos($quote_author, ' &#8211; ')), 'ISO-8859-15', 'UTF-8');
$quote_provider = '<a href="http://es.proverbia.net" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'BrainyQuote':
$quote_provider = '<a href="http://www.brainyquote.com" target="_blank">' . $provider[0]->name . '</a>';
break;
case 'The Quotations Page':
$quote_provider = '<a href="http://www.quotationspage.com" target="_blank">' . $provider[0]->name . '</a>';
}
$quote_text = '<p>' . trim($quote_text, '"') . '</p>';
$quote_author = '<p>— ' . $quote_author . ' (' . $quote_provider . ')</p>';
}
echo '<div class="quote-text">' . $quote_text . '</div>';
echo '<div class="quote-author">' . $quote_author . '</div>';
?>
</li>
<?php endwhile; ?>
</ul><!-- .dpe-flexible-posts -->
<?php
<?php
endif; // End have_posts()
echo $after_widget;

View file

@ -7,17 +7,16 @@
*/
if ( !function_exists( 'write_log' ) ) {
function write_log( $log ) {
# if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ), 3, '/tmp/manuel.cillero.errors.log' );
}
else {
error_log( "$log\n", 3, '/tmp/manuel.cillero.errors.log' );
}
# }
}
/*
* Add help text to screen in a metabox.
* See https://code.tutsplus.com/articles/customizing-the-wordpress-admin-help-text--wp-33281
*/
add_action( 'add_meta_boxes', 'help_featured_image_metabox' );
function help_featured_image_metabox() {
add_meta_box( 'help-featured-image', 'Sobre la imagen destacada', 'help_featured_image_metabox_content', 'post', 'side' );
}
function help_featured_image_metabox_content() {
echo("La mejor proporción para la imagen destacada es la que mantiene una relación de 2'5 a 1. Normalmente <tt>1200x470</tt>.</p>");
}
/*
@ -28,23 +27,11 @@ add_filter( 'body_class', 'add_category_name' );
function add_category_name( $classes = '' ) {
if ( is_single() ) {
$category = get_the_category();
$classes[] = 'category-' . $category[0]->slug;
$classes[] = 'category-' . $category[0]->slug;
}
return $classes;
}
/*
* Add EXIF data only in photoblog posts using a filter.
* See https://ithemes.com/2011/03/20/automatically-add-content-to-your-wordpress-posts-and-pages#Using_Filters
*/
add_filter( 'the_content', 'add_exif_data' );
function add_exif_data( $content ) {
if ( function_exists('exifography_display_exif') && is_single() && has_category( 976 ) ) {
$content .= exifography_display_exif();
}
return $content;
}
/*
* Visual consolidation of tag clouds.
* See https://codex.wordpress.org/Function_Reference/wp_tag_cloud
@ -82,9 +69,20 @@ function fix_single_post_title( $args, $id ) {
else {
// Post categories by name:
$categories = array_values( array_column( get_the_category(), 'name' ) );
if ( in_array( $categories[0], array( 'Blog', 'Archivo de notas', 'Apuntes', 'Álbum de fotos' ) ) ) {
$args['title'] = $categories[0];
}
switch ($categories[0]) {
case 'Blog':
$args['title'] = 'En el blog';
break;
case 'Notas rápidas':
$args['title'] = 'En mis notas';
break;
case 'Snippets':
$args['title'] = 'Picando código';
break;
case 'Álbum de fotos':
$args['title'] = 'Foto del álbum';
break;
}
}
}
elseif ( is_category() || is_tag() ) {
@ -113,19 +111,25 @@ function avia_change_tag_page_layout( $layout, $context ) {
}
/*
* Register new icons as a theme icons fot GitHub and GitLab.
* Register new icons as a theme icons.
* See https://kriesi.at/documentation/enfold/custom-social-icons/
*/
add_filter( 'avf_default_icons', 'avia_add_custom_icon', 10, 1 );
function avia_add_custom_icon( $icons ) {
$icons['github'] = array( 'font' =>'fontello', 'icon' => 'uf09b' );
$icons['gitlab'] = array( 'font' =>'fontello', 'icon' => 'uf296' );
$icons['GitHub'] = array( 'font' =>'fontello', 'icon' => 'uf09b' );
$icons['GitLab'] = array( 'font' =>'fontello', 'icon' => 'uf296' );
$icons['SoloGit'] = array( 'font' =>'fontello', 'icon' => 'ue806' );
$icons['Mastodon'] = array( 'font' =>'fontello', 'icon' => 'ue804' );
$icons['Bluesky'] = array( 'font' =>'fontello', 'icon' => 'ue805' );
return $icons;
}
add_filter( 'avf_social_icons_options', 'avia_add_custom_social_icon', 10, 1 );
function avia_add_custom_social_icon( $icons ) {
$icons['GitHub'] = 'github';
$icons['GitLab'] = 'gitlab';
$icons['GitHub'] = 'GitHub';
$icons['GitLab'] = 'GitLab';
$icons['SoloGit'] = 'SoloGit';
$icons['Mastodon'] = 'Mastodon';
$icons['Bluesky'] = 'Bluesky';
return $icons;
}
@ -146,7 +150,7 @@ function avia_same_category_filter( $settings ) {
add_filter( 'get_the_terms', 'exclude_taxonomy_terms', 10, 3 );
function exclude_taxonomy_terms( $terms, $post, $taxonomy ) {
// List of taxonomy terms (slugs) to exclude:
$exclude_slugs = array( 'portada', 'pelis-y-series', 'lecturas', 'twitter', 'linkedin', 'facebook' );
$exclude_slugs = array( 'portada', 'pelis-y-series', 'lecturas' );
if ( !is_admin() ) {
foreach( $terms as $key => $term ) {
@ -171,6 +175,9 @@ function avia_change_breadcrumb( $trail, $args ) {
elseif ( is_category() ) {
$trail = array();
}
elseif ( is_tax( 'quote_author_tag' ) ) {
array_splice( $trail, 1, 0, array( '<a href="/quotes">Libro de citas</a>' ) );
}
return $trail;
}
@ -202,7 +209,7 @@ function before_save_post( $data, $postarr ) {
}
else {
$data['post_content'] = substr( $data['post_content'], $dotpos + 2 );
}
}
}
}
else {
@ -282,6 +289,14 @@ function social_post_defautl_thumbnail( $html, $post_id, $post_thumbnail_id, $si
return $html;
} */
/*
* Remove provider previews.
*
add_filter( 'embed_oembed_html', 'wp_remove_oembed_providers', 10, 2 );
function wp_remove_oembed_providers( $html, $url ) {
return '<a href="' . esc_url( $url ) . '" rel="noopener noreferrer" target="_blank">' . esc_html( $url ) . '</a>';
} */
/*
* Add a button to display the number of characters in Title and Content editor;
* and also add a character counter to the Excerpt box (with no limit).
@ -538,7 +553,7 @@ class enfold_post_footer_widget extends WP_Widget {
* See https://wordpress.stackexchange.com/questions/107113/output-before-and-after-the-loop
*/
register_sidebar( array(
'name' => 'Displayed After Loop',
'name' => 'Displayed After Quote',
'id' => 'after-loop',
'description' => '',
'before_widget' => '<div class="quotes-after-loop">',
@ -546,13 +561,32 @@ register_sidebar( array(
'before_title' => '<h5>',
'after_title' => '</h5>',
) );
add_action( 'loop_end', 'wp_content_after_loop' );
function wp_content_after_loop( $query ) {
if ( $query->is_main_query() && is_active_sidebar( 'after-loop' ) ) {
add_action( 'loop_end', 'wp_content_after_quote' );
function wp_content_after_quote( $query ) {
if ( ! $query->is_main_query() ) {
return;
}
if ( ! ( is_post_type_archive( 'quote' ) || is_singular( 'quote' ) ) ) {
return;
}
if ( is_active_sidebar( 'after-loop' ) ) {
dynamic_sidebar( 'after-loop' );
}
}
/**
* Show all quotes by author with no pagination.
*/
add_action( 'pre_get_posts', 'wp_all_quotes_by_author' );
function wp_all_quotes_by_author( $query ) {
if ( ! $query->is_main_query() ) {
return;
}
if ( $query->is_tax( 'quote_author_tag' ) ) {
$query->set( 'posts_per_page', -1 );
}
}
/*
* Restore the font size in the tag cloud widget using a copy of the entire Avia
* stylesheet "enfold/css/avia-snippet-widget.css" from Enfold 4.5, and removing
@ -608,3 +642,17 @@ function hide_content_antibots_shortcode( $atts, $content = null ) {
}
return antispambot( $content );
}
/*
* Ensure HTML code using Highlighting Code Block plugin with Enfold Theme.
* Use: [hcb_html]text or email[/hcb_html].
* See https://kriesi.at/support/topic/codeblock-within-editor-not-working-enfold-4-7-3/#post-1206456
*/
add_shortcode( 'html_tag', 'hcb_html_shortcode' );
add_shortcode( 'html_code', 'hcb_html_shortcode' );
add_shortcode( 'html_block', 'hcb_html_shortcode' );
function hcb_html_shortcode( $atts, $content = null ) {
$content = str_replace( '', '&lt;', $content );
$content = str_replace( '', '&gt;', $content );
return $content;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,5 @@
/* PrismJS 1.26.0
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+bash+batch+dart+diff+docker+git+json+markdown+markup-templating+perl+php+rust+sql+toml+typescript&plugins=line-highlight+line-numbers */
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{position:relative;margin:.5em 0;overflow:visible;padding:1px}pre[class*=language-]>code{position:relative;z-index:1;border-left:10px solid #358ccb;box-shadow:-1px 0 0 0 #358ccb,0 0 0 1px #dfdfdf;background-color:#fdfdfd;background-image:linear-gradient(transparent 50%,rgba(69,142,209,.04) 50%);background-size:3em 3em;background-origin:content-box;background-attachment:local}code[class*=language-]{max-height:inherit;height:inherit;padding:0 1em;display:block;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}:not(pre)>code[class*=language-]{position:relative;padding:.2em;border-radius:.3em;color:#c92c2c;border:1px solid rgba(0,0,0,.1);display:inline;white-space:normal}pre[class*=language-]:after,pre[class*=language-]:before{content:'';display:block;position:absolute;bottom:.75em;left:.18em;width:40%;height:20%;max-height:13em;box-shadow:0 13px 8px #979797;-webkit-transform:rotate(-2deg);-moz-transform:rotate(-2deg);-ms-transform:rotate(-2deg);-o-transform:rotate(-2deg);transform:rotate(-2deg)}pre[class*=language-]:after{right:.75em;left:auto;-webkit-transform:rotate(2deg);-moz-transform:rotate(2deg);-ms-transform:rotate(2deg);-o-transform:rotate(2deg);transform:rotate(2deg)}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#7d8b99}.token.punctuation{color:#5f6364}.token.boolean,.token.constant,.token.deleted,.token.function-name,.token.number,.token.property,.token.symbol,.token.tag{color:#c92c2c}.token.attr-name,.token.builtin,.token.char,.token.function,.token.inserted,.token.selector,.token.string{color:#2f9c0a}.token.entity,.token.operator,.token.url,.token.variable{color:#a67f59;background:rgba(255,255,255,.5)}.token.atrule,.token.attr-value,.token.class-name,.token.keyword{color:#1990b8}.token.important,.token.regex{color:#e90}.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,.5)}.token.important{font-weight:400}.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.namespace{opacity:.7}@media screen and (max-width:767px){pre[class*=language-]:after,pre[class*=language-]:before{bottom:14px;box-shadow:none}}pre[class*=language-].line-numbers.line-numbers{padding-left:0}pre[class*=language-].line-numbers.line-numbers code{padding-left:3.8em}pre[class*=language-].line-numbers.line-numbers .line-numbers-rows{left:0}pre[class*=language-][data-line]{padding-top:0;padding-bottom:0;padding-left:0}pre[data-line] code{position:relative;padding-left:4em}pre .line-highlight{margin-top:0}
pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)}
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,90 @@
<?php
if( ! defined( 'ABSPATH' ) ){ die(); }
global $avia_config, $more;
/**
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
echo avia_title( array( 'title' => avia_which_archive() ) );
do_action( 'ava_after_main_title' );
/**
* @since 5.6.7
* @param string $main_class
* @param string $context file name
* @return string
*/
$main_class = apply_filters( 'avf_custom_main_classes', 'av-main-' . basename( __FILE__, '.php' ), basename( __FILE__ ) );
?>
<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
<div class='container template-blog '>
<main class='content <?php avia_layout_class( 'content' ); ?> units <?php echo $main_class; ?>' <?php avia_markup_helper( array( 'context' => 'content' ) );?>>
<div class="category-term-description">
<?php echo term_description(); ?>
</div>
<?php
global $wp_query, $posts;
$backup_query = $wp_query;
$sorted = array( 'post' => array() );
$post_type_obj = array();
foreach( $posts as $post )
{
$sorted[ $post->post_type ][] = $post;
if( empty( $post_type_obj[ $post->post_type] ) )
{
$post_type_obj[ $post->post_type ] = get_post_type_object( $post->post_type );
}
}
$avia_config['blog_style'] = apply_filters( 'avf_blog_style', avia_get_option( 'blog_style', 'multi-big' ), 'tag' );
foreach( $sorted as $key => $post_type )
{
if( empty( $post_type ) )
{
continue;
}
$args = array_merge( $wp_query->query_vars, array( 'post_type' => $key ) );
query_posts( $args );
$more = 0;
get_template_part( 'includes/loop', 'index' );
$wp_query = $backup_query;
}
if ( is_active_sidebar( 'after-loop' ) ) :
echo '<div class="quotes-after-loop" style="margin-top: 80px;">';
dynamic_sidebar( 'after-loop' );
echo '</div>';
endif;
?>
<!--end content-->
</main>
<?php
//get the sidebar
$avia_config['currently_viewing'] = 'blog';
get_sidebar();
?>
</div><!--end container-->
</div><!-- close default .container_wrap element -->
<?php
get_footer();