Suporte » Ajustando o WordPress » Post inteiro na Home

  • Não estou conseguindo colocar um post inteiro na home. Aparece apenas o título.
    No index.php aparece apenas isso:
    <?php get_header(); ?>

    <div role=”main”>
    <div class=”row”>

    <p class=”no-bradcrumbs”></p>

    <section class=”span9″>

    <?php if (have_posts()) : while(have_posts()) : the_post(); ?>

    <?php get_template_part(‘content’, get_post_format()); ?>

    <?php endwhile; else : ?>
    <p>

    <h1><?php _e(‘No posts were found.’, ‘coolstuff’); ?></h1>

    </p>
    <?php endif; ?>

    </section> <!– /.span9 [main content] –>

    <aside class=”span3″>

    <?php get_sidebar(); ?>

    </aside> <!– /.span3 [sidebar] –>

    </div> <!– /.row –>

    </div> <!– /main role –>

    <?php get_footer(); ?>

    Então não consigo trocar the_excerpt por the_content.

    O conteúdo do post aparece normal quando é uma foto e uma frase apenas.

    Obrigado.

Visualizando 8 respostas - 1 até 8 (de um total de 8)
  • Deve ter um arquivo que exibe o conteúdo para cada tipo de post.

    Eu não sei qual é o tipo de post que voce esta editando… então é melhor olhar um por um… os arquivos tem o nome content-{tipo de post}.php

    Existem vários tipos. Por exemplo: aside, linkimage, video…

    Criador do tópico rafito

    (@rafito)

    Entendi
    Eu estou tentando postar no modo padrão “content.php”
    e aparece assim:
    <?php
    /***********************************************************************************************/
    /* Template for the default post format */
    /***********************************************************************************************/
    ?>

    <article <?php post_class(array(‘element-box’)); ?> id=”post-<?php the_ID(); ?>”>

    <header class=”element-top-bar clearfix”>
    <?php the_author_posts_link(); ?>
     
    <b class=”time-info fr”><?php the_time( ‘h A | d M’ ); ?></b>
    </header>

    <h2>
    “>
    <?php the_title(); ?>

    </h2>

    <?php if(get_post_meta($post->ID, ‘coolstuff_atr_video’, true)): ?>

    <figure>
    <?php echo get_post_meta($post->ID, ‘coolstuff_atr_video’, true); ?>
    </figure>

    <?php else: ?>

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

    <?php

    $domsxe = simplexml_load_string(get_the_post_thumbnail());
    $thumbs = $domsxe->attributes()->src;

    ?>

    <figure>
    ” class=”show-image” title=”This is image caption”>
    <?php the_post_thumbnail(); ?>
    <b class=”zoom-icon”></b>

    </figure>

    <?php endif; ?>
    <?php endif; ?>
    <?php add_filter(‘the_content’, ‘get_audio_link’) ?>
    <?php the_content(‘

    Read more’); ?>

    <footer class=”element-bottom-bar”>

    • <?php

      // Only show the comments link if comments are allowed and it’s not password protected

      if (comments_open() && !post_password_required()) {
      comments_popup_link(‘<b class=”comment-icon”></b> 0 Comments’, ‘<b class=”comment-icon”></b> 1 Comment’, ‘<b class=”comment-icon”></b> % Comments’);
      }
      ?>

    • <?php

      ob_start();

      the_category(‘,’, ‘multiple’);

      $cat = ob_get_contents(); /* Captured output */

      ob_end_clean(); /* Stop capture */

      $full_cat = explode(“,”, $cat);

      echo $full_cat[0];

      ?>

    • “>Permalink

    </footer>
    </article> <!– /.element-box [image]–>

    Desconfio que seu template esteja alterando o funcionamento padrão do the_content()…

    Se no texto você não inseriu a tag redymore, era pra exibir o post COMPLETO na home.

    Procure por ‘the_content’ no function.php, deve ter algum filter/event alterando o funcionamento dele…

    Se você quiser, posta ele aqui para eu dar uma olhada. Se for muito grande, coloca ele em um github da vida (SE POSTAR AQUI E ELE FOR GRANDE, VAI FICAR DIFÍCIL ENTENDER ALGUMA COISA)!

    Criador do tópico rafito

    (@rafito)

    Olha, acho que achei aqui. Mas sou muito ‘noob’. Olha como está, parece que realmente está com filtro:

    /* Clear br form content */
    /***********************************************************************************************/

    function clear_br($content){

    return str_replace(“
    “,””, $content);

    }

    add_filter(‘the_content’, ‘clear_br’);

    e não sei se faz diferença, mas a parte do readmore está assim:

    /* Filter content for read more */
    /***********************************************************************************************/

    function manual_excerpt($content) {
    $audio = get_audio_link($content, true);
    $read = ‘

    ‘.__(‘Read more’, ‘coolstuff’).’‘;
    $excerpt = get_the_excerpt();

    $new = $audio.'<p>’.$excerpt.'</p>’;
    return $new;
    }

    O que eu faço? Obrigado

    Pensei em algumas possibilidades:

    1 – Você adicionou a tag readymore (<!–more–>) no seu post (no texto).

    2 – Não é esse arquivo content…Existe outro arquivo content-{postype}.php que é chamado. E nele tem um the_excerpt() em vez de the_content().

    3 – No functions.php tem outro filter para ‘the_content’… esse que você achou não faz nada significativo, apenas ‘remove’ as quebras de linha do texto (não sei porque ele faz isso…).

    Criador do tópico rafito

    (@rafito)

    1. Não inseri no post não. E olhei-o agora, nem automatco está com essa tag

    2. Esse arquivo ‘postype’ eu não tenho. São esses arquivos que aparecem no meu tema:
    Modelos
    Modelo de página 404
    (404.php)
    Tax-meta-class.php
    Comentários
    (comments.php)
    content-audio.php
    content-events.php
    content-home-sidebar.php
    content-masonry.php
    content-members.php
    content-portfolio.php
    content-services.php
    content-timeline.php
    content.php
    Rodapé
    (footer.php)
    shortcodes.php
    Funções do tema
    (functions.php)
    Cabeçalho
    (header.php)
    home.php
    Modelo da página principal
    (index.php)

    3. Não tem outro filter não.

    Acho que você tem que editar o arquivo home.php (pelo q eu entendi, esta editando o index.php). Procure por ‘the_excerpt’ e substitua por ‘the_content’!

    Ps: Se isso não funcionar, avalie a possibilidade de trocar de tema… 🙂

    Criador do tópico rafito

    (@rafito)

    É! acho que vou trocar de tema mesmo. Mandei um email para o suporte do tema. A home.php não tinha ‘the_excerpt’.
    Valeu, Lucas!

Visualizando 8 respostas - 1 até 8 (de um total de 8)
  • O tópico ‘Post inteiro na Home’ está fechado para novas respostas.