Ocultar data e autor do post na home
-
Como ocultar a data e o autor dos posts nas chamadas da home?
-
Isto faz parte do loop do seu theme.
Procure no single.php e page.php
Fala, belloli.
Cara, sou praticamente leigo. O que exatamente eu devo procurar no single ou no page?
Fui lá tem umas 10 linhas em cada um.
Vai ser algo mais ou menos assim:
<?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>
É isto mesmo. Se não testar, não vai descobrir.
Olha só, no meu single.php tem isso:
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Graphene * @since Graphene 1.0 */ get_header(); ?> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-single.php and that will be used instead. */ get_template_part('loop', 'single'); ?> <?php get_footer(); ?>
E no page.php eu tenho isso:
<?php /** * The Template for displaying all single pages. */ get_header(); ?> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-single.php and that will be used instead. */ get_template_part('loop', 'page'); ?> <?php get_footer(); ?>
Olá,
É meio chato modificar temas como o Graphene, o mais simples é criar o tema filho normalmente e no
index.php
adicionar só o que quer usar. A parte de gerar as postagens deverá ficar explícita no arquivo, o que não ocorre no Graphene.No tema filho, adicione o arquivo
loop.php
e modifique por lá o contexto para listagens da home.Diana, quanto você cobra pra fazer isso pra mim? hehehe
get_template_part('loop', 'page');
PAGE, verifique o page.phpOs códigos a serem removidos para ocultar a data e o autor do post, devem estar inseridos no
loop-single.php
e/ou noloop-page.php
e deve ser algo parecido com o que o @gustamociaro postou ali acima:<?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>
vamos com calma.
Eu achei lá no loop… mas acontece que quando removo, ele remove também dentro do post e não é esse o objetivo.No meu tema não tem loop. O que fazer? Real Estate v1.3
Loop há, o modo que foi empregado é que pode ser diferente.
Conheço seu theme mas não o código, porém, pode ser algo como:
if ($post->post_type != "post")
Ainda assim, o objetivo do tópico é autor e data, e como disse gustamociaro:
Vai ser algo mais ou menos assim:
<?php the_time(‘F jS, Y’) ?> by <?php the_author_posts_link() ?>Procure por: “author”, “time” ou “date”.
eu estou usando o tema “communist” e tambem queria retirar nome e data dos posts, na page.php tem isso…
<?php get_header(); ?> <?php get_sidebar(); ?> <div id="content"><a name="content"></a> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="title"> <div class="date"><span> <?php the_time('M-j-Y'); ?></span> </div> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="met"><span>Posted by <?php the_author(); ?> under <?php the_category(', '); ?></span></div> </div> <div class="cover"> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> <div class="tags"><?php if (function_exists('the_tags')) { ?><strong>Tags: </strong><?php the_tags('', ', ', ''); ?><br /><?php } ?></div> </div> </div> <div class="postmetadata"> <div class="com"><?php comments_popup_link('ADD COMMENTS', '1 COMMENT', '% COMMENTS'); ?></div> </div> </div> <?php comments_template(); ?> <?php endwhile; endif; ?> </div> <?php get_footer(); ?>
Linha 11 e 13
11:<?php the_time('M-j-Y'); ?>
13: Posted by<?php the_author(); ?>
Na minha page.php não encontrei “time” nem “author” e nem “date”.
- O tópico ‘Ocultar data e autor do post na home’ está fechado para novas respostas.