Estas en: Home > category

Entradas etiquetadas con category

Cron Job WordPress

Versión 0.5 del plugin para WordPress Collapsing Category List

0

En esta nueva versión del plugin se ha añadido una nueva página de administración para el plugin, que podéis encontrar en el menú Settings (Ajustes)/Collapsing category list.

Desde ella podréis activar una nueva funcionalidad para poder limitar el número de categorías y subcategorías que se pueden seleccionar en el listado de categorías al crear o modificar un post. Se puede indicar más de un nivel de subcategorías y el número de categorías máxima que se pueden seleccionar. Si lo dejáis a cero no habrá límite; si indicáis una sola categoría o subcategoría el checkbox se convertirá en un radio button para cada categoría de ese nivel. Si se supera el número de categorías que se pueden seleccionar, el usuario verá un mensaje indicando que este límite sea superado, impidiéndole que pueda seleccionar más categorías.

Hasta la próxima versión.

 

Cron Job WordPress

Versión 0.4 del plugin para WordPress Collapsing Category List

0

Poquito a poco se va aumentando el número de características y utilidades que el plugin ofrece. En esta ocasión se ha añadido la posibilidad de mantener colapsadas las categorías cuando se muestra la página de un post al usuario. Además se han corregido varios bugs.

Como novedad para los desarrolladores de WordPress que usen el plugin, se han añadido los archivos de traducción para español e inglés (que ya era hora), y la compatibilidad para poder traducir el plugin a cualquier otro idioma.

Cron Job WordPress

Versión 0.3 del plugin para WordPress Collapsing Category List

4

En esta nueva versión se ha actualizado el plugin para adaptarlo a WordPress 4.4, añadiéndole compatibilidad con versiones anteriores.

Se han sustituido las imágenes que hacían de iconos para expandir y colapsar las categorías por caracteres de texto, que permitirán aumentar su tamaño por css, de tal forma que puedan visualizarse correctamente en dispositivos móviles y responsive web. Por retrocompatibilidad se ha añadido un checkbox que permite cambiar entre las imágenes antiguas y los estilos css que mostrarán los nuevos iconos.

Se ha añadido la opción de ocultar los iconos de expandir y colapsar las categorías para poder mejorar la visualización y usabilidad en los dispositivos móviles.

Cron Job WordPress

Versión 0.2.1 del plugin para WordPress Collapsing Category List

0

Pues sí, este pequeño plugin propio sigue creciendo. Como no suelo publicar post relativos a las actualizaciones de los plugins que he creado (mal por mi parte) os explicaré qué es, para qué sirve y los cambios que se han realizado hasta la fecha.

Collapsing Category List es un plugin para WordPress que, a través de un filtro, modifica el widget de categorías de WordPress para que las subcategorías colapsen y no se muestren directamente. Además de otras características mejoradas.

Subcategoría colapsada

Subcategoría colapsada

Subcategoría expandida

Subcategoría expandida

 

Las mejoras de las que dispone el plugin son las siguientes:

 

  • Colapsar y expandir el listado de subcategorías.
  • Posibilidad de ordenar las categorías por nombre o slug.
  • Posibilidad de ocultar categorías.
  • Posibilidad de eliminar el enlace de todas las categorías.
  • Posibilidad de eliminar el enlace de una o varias categorías.
  • Posibilidad de cambiar las imágenes que indican la acción de colapsar o expandir un listado de subcategorías. Por defecto aparecen los símbolos más (+) y menos (-).

Cualquier sugerencia o idea para mejorar el plugin es bienvenida.

Página de descarga: https://wordpress.org/plugins/collapsing-category-list/

Cron Job WordPress

WordPress 3.x para desarrolladores: Temas y plantillas, category.php, author.php, archive.php y 404.php

0

Estas son las últimas plantillas que crearemos para nuestro tema.

 

CATEGORY.PHP

Creamos el archivo category.php y añadimos el siguiente código:

[codesyntax lang=»php»]

<?php
/**
 * The template for displaying Category Archive pages.
 *
 * @package WordPress
 * @subpackage New_Theme
 */

get_header(); ?>

		<section id="primary">
			<div id="content" role="main">

			<?php if ( have_posts() ) : ?>

				<header class="page-header">
					<h1 class="page-title"><?php
						printf( __( 'Category Archives: %s', 'newtheme' ), '<span>' . single_cat_title( '', false ) . '</span>' );
					?></h1>

					<?php
						$category_description = category_description();
						if ( ! empty( $category_description ) )
							echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
					?>
				</header>

				<?php newtheme_content_nav( 'nav-above' ); ?>

				<?php /* Start the Loop */ ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php
						/* Include the Post-Format-specific template for the content.
						 * If you want to overload this in a child theme then include a file
						 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
						 */
						get_template_part( 'content', get_post_format() );
					?>

				<?php endwhile; ?>

				<?php newtheme_content_nav( 'nav-below' ); ?>

			<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'newtheme' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'newtheme' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>

			</div><!-- #content -->
		</section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

[/codesyntax]

Esta plantilla está creada para mostrar los post que están en una misma categoría. La estructura de la página es idéntica al del resto que hemos visto del estilo.

 

AUTHOR.PHP

Creamos el archivo author-php y añadimos el siguiente código:

[codesyntax lang=»php»]

<?php
/**
 * The template for displaying Author Archive pages.
 *
 * @package WordPress
 * @subpackage New_Theme
 */

get_header(); ?>

		<section id="primary">
			<div id="content" role="main">

			<?php if ( have_posts() ) : ?>

				<?php
					/* Queue the first post, that way we know
					 * what author we're dealing with (if that is the case).
					 *
					 * We reset this later so we can run the loop
					 * properly with a call to rewind_posts().
					 */
					the_post();
				?>

				<header class="page-header">
					<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'newtheme' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
				</header>

				<?php
					/* Since we called the_post() above, we need to
					 * rewind the loop back to the beginning that way
					 * we can run the loop properly, in full.
					 */
					rewind_posts();
				?>

				<?php newtheme_content_nav( 'nav-above' ); ?>

				<?php
				// If a user has filled out their description, show a bio on their entries.
				if ( get_the_author_meta( 'description' ) ) : ?>
				<div id="author-info">
					<div id="author-avatar">
						<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'newtheme_author_bio_avatar_size', 60 ) ); ?>
					</div><!-- #author-avatar -->
					<div id="author-description">
						<h2><?php printf( __( 'About %s', 'newtheme' ), get_the_author() ); ?></h2>
						<?php the_author_meta( 'description' ); ?>
					</div><!-- #author-description	-->
				</div><!-- #author-info -->
				<?php endif; ?>

				<?php /* Start the Loop */ ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php
						/* Include the Post-Format-specific template for the content.
						 * If you want to overload this in a child theme then include a file
						 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
						 */
						get_template_part( 'content', get_post_format() );
					?>

				<?php endwhile; ?>

				<?php newtheme_content_nav( 'nav-below' ); ?>

			<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'newtheme' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'newtheme' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>

			</div><!-- #content -->
		</section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

[/codesyntax]

Esta plantilla muestra los post que un autor haya escrito. Lo más relevante del código es que para obtener los datos del autor se recupera el primer post, se genera la cabecera del contenido y después se reinicia el dataset para mostrar los post desde el primero, utilizando para ello la función rewind_posts().

 

ARCHIVE.PHP

Creamos el archivo archive.php y añadimos el siguiete código:

[codesyntax lang=»php»]

<?php
/**
 * The template for displaying Archive pages.
 *
 * Used to display archive-type pages if nothing more specific matches a query.
 * For example, puts together date-based pages if no date.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 */

get_header(); ?>

		<section id="primary">
			<div id="content" role="main">

			<?php if ( have_posts() ) : ?>

				<header class="page-header">
					<h1 class="page-title">
						<?php if ( is_day() ) : ?>
							<?php printf( __( 'Daily Archives: %s', 'newtheme' ), '<span>' . get_the_date() . '</span>' ); ?>
						<?php elseif ( is_month() ) : ?>
							<?php printf( __( 'Monthly Archives: %s', 'newtheme' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'newtheme' ) ) . '</span>' ); ?>
						<?php elseif ( is_year() ) : ?>
							<?php printf( __( 'Yearly Archives: %s', 'newtheme' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'newtheme' ) ) . '</span>' ); ?>
						<?php else : ?>
							<?php _e( 'Blog Archives', 'newtheme' ); ?>
						<?php endif; ?>
					</h1>
				</header>

				<?php newtheme_content_nav( 'nav-above' ); ?>

				<?php /* Start the Loop */ ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php
						/* Include the Post-Format-specific template for the content.
						 * If you want to overload this in a child theme then include a file
						 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
						 */
						get_template_part( 'content', get_post_format() );
					?>

				<?php endwhile; ?>

				<?php newtheme_content_nav( 'nav-below' ); ?>

			<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'newtheme' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'newtheme' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>

			</div><!-- #content -->
		</section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

[/codesyntax]

Esta plantilla muestra los post publicados en una fecha o entre fechas concretas.

Ir arriba