Remover datas em posts do WordPress

  • Autor Autor Krauzer
  • Data de início Data de início
Este tópico foi traduzido automaticamente do espanhol. Ver original
Krauzer

Krauzer

1
Lambda
SEO
Suscripción a IA
Olá amigos do ForoBeta, estou em processo de otimização da minha página no WordPress e estou fazendo modificações. Uma delas eu não sei como fazer, que é "Remover as datas em cada post", já que pode ser substituído por algo mais interessante do que uma simples data.

Alguém sabe? Se sim, que me indique em qual parte do template e o que modificar, substituir ou eliminar no template.

Abraços, espero comentários!
 
Foi útil? Participe da conversa

Com sua conta grátis você pode responder, mandar mensagem privada ao autor e comprar com Saldo retido: o pagamento é liberado quando você recebe o combinado.

Leva 30 segundos · você volta a este tópico ao terminar
<?php the_date('m, Y') ?>
Procure por the_time no seu template, seja index.php, archive.php, category.php ou single.php.
Claro, o conteúdo de (' ') pode variar dependendo do formato em que você o tenha.
 
Se você quiser remover dos posts, tem que procurar no arquivo single.php, e se quiser remover da home/index, tem que procurar o arquivo index.php ou home.php

Inserir CODE, HTML ou PHP:
/<?php the_time('j F Y') ?>
 
Olá
Estou ressuscitando este tópico já que não encontro a solução e, como sou um pouco desajeitado e não quero estragar o tema, primeiro pergunto...
Como posso remover a data deste tema?

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
 * @since Twenty Eleven 1.0
 */

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', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' ); ?>
						<?php elseif ( is_month() ) : ?>
							<?php printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
						<?php elseif ( is_year() ) : ?>
							<?php printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
						<?php else : ?>
							<?php _e( 'Blog Archives', 'twentyeleven' ); ?>
						<?php endif; ?>
					</h1>
				</header>

				<?php twentyeleven_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 twentyeleven_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', 'twentyeleven' ); ?></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.', 'twentyeleven' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>

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

<?php get_sidebar(); ?>
<?php get_footer(); ?>
 
Remova este código

. get_the_date()

. get_the_date( 'F Y' )

. get_the_date( 'Y' )
 
Não é exatamente para removê-las, mas sim para que não sejam exibidas quando um post tem x dias de antiguidade.

O plugin se chama WP Old Post Date Remover e, para que a data não apareça nos resultados do Google quando é um post antigo, funciona 😉
 
Voltar
Topo