marypaixao 0 Denunciar post Postado Agosto 30, 2010 Olá! Estou tentando mudar o layout do meu blog e peguei um tema super funcional do wordpress, porém ele veio cheio de erros e como sou noob não consigo resolvê-los. Ficarei muito agradecida se alguém puder me ajudar. O meu primeiro problema é que os posts não estão aparecendo na minha página principal. Fica assim: Se precisarem olhar algum código pra saber melhor, é só avisar! Compartilhar este post Link para o post Compartilhar em outros sites
brunoqueiros 0 Denunciar post Postado Agosto 30, 2010 Coloca o código da página index.php, para dar uma olhada. Compartilhar este post Link para o post Compartilhar em outros sites
marypaixao 0 Denunciar post Postado Agosto 30, 2010 Aqui está o index.php <?php if (is_archive()) $post_number = get_option('personalpress_archivenum_posts'); if (is_search()) $post_number = get_option('personalpress_searchnum_posts'); if (is_tag()) $post_number = get_option('personalpress_tagnum_posts'); if (is_category()) $post_number = get_option('personalpress_catnum_posts'); if (is_home()) $args=array( 'showposts'=>get_option('personalpress_homepage_posts'), 'paged'=>$paged, 'category__not_in' => get_option('personalpress_exlcats_recent'), ); ?> <?php get_header(); ?> <?php global $query_string; if (is_category()) query_posts($query_string . "&showposts=$post_number&paged=$paged&cat=$cat"); elseif (is_home()) query_posts($args); else query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?> <div id="main"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $thumb = ''; $width = 175; $height = 175; $classtext = ''; $titletext = get_the_title(); $thumb = $thumbnail["thumb"]; ?> <?php global $post; $page_result = is_search() && ($post->post_type == 'page') ? true : false; ?> <div class="entry-wrap<?php if ($page_result) echo(' page_result'); ?>"> <div class="entry"> <h2 class="title"><a href="<php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s', 'PersonalPress'), $titletext) ?>"><php the_title(); ?></a></h2> <?php if (get_option('personalpress_postinfo1') <> '') { ?> <?php if ( in_array('date', get_option('personalpress_postinfo1')) ) { ?> <p class="date"> <span class="month"><?php the_time('M'); ?></span> <span class="day"><?php the_time('d'); ?></span> </p> <?php }; ?> <?php }; ?> <div class="entry-content clearfix"> <?php if($thumb <> '' && get_option('personalpress_thumbnails_index') == 'on') { ?> <div class="thumb"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?> <a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s', 'PersonalPress'), $titletext) ?>"><span class="overlay"></span></a> </div> <!-- end .thumb --> <?php }; ?> <?php if (get_option('personalpress_blog_style') == 'on') the_content(""); else { ?> <p><php truncate_post(370); ?></p> <?php }; ?> </div> <!-- end .entry-content --> <div class="post-meta-top"></div> <div class="post-meta clearfix"> <?php if (get_option('personalpress_postinfo1') <> '') { ?> <?php if ( in_array('author', get_option('personalpress_postinfo1')) || in_array('comments', get_option('personalpress_postinfo1')) || in_array('categories', get_option('personalpress_postinfo1')) ) { ?> <?php if ( in_array('author', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info author"> <span class="right-sep"> <?php the_author_posts_link(); ?> </span> </span> <?php }; ?> <?php if ( in_array('comments', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info comments-number"> <span class="right-sep"> <?php comments_popup_link(__('0 comments','PersonalPress'), __('1 comment','PersonalPress'), '% '.__('comments','PersonalPress')); ?> </span> </span> <?php }; ?> <?php if ( in_array('categories', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info categories"> <span class="right-sep"> <?php the_category(', ') ?> </span> </span> <?php }; ?> <?php }; ?> <?php }; ?> </div> <!-- end .post-meta --> </div> <!-- end .entry --> </div> <!-- end .entry-wrap --> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <?php include(TEMPLATEPATH . '/includes/navigation.php'); ?> <?php } ?> <?php else : ?> <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?> <?php endif; wp_reset_query(); ?> </div> <!-- end #main --> <?php get_sidebar(); ?> <?php get_footer(); ?> Compartilhar este post Link para o post Compartilhar em outros sites
Anderson Narciso 3 Denunciar post Postado Setembro 1, 2010 Linha 56 incorreto <p><php truncate_post(370); ?></p> correto <p><?php truncate_post(370); ?></p> Compartilhar este post Link para o post Compartilhar em outros sites
marypaixao 0 Denunciar post Postado Setembro 2, 2010 Opa, obrigada pela resposta! Mas eu tentei aqui e infelizmente não deu certo. Quando eu faço essa alteração aparece a mensagem: Fatal error: Call to undefined function truncate_post() in /home/muitopou/public_html/alosom/wp-content/themes/PersonalPress/index.php on line 56 E quando eu tiro volta ao normal... Que é só o espaço do post, sem o post -.- Já tentei tirar tudo o que eu achei estranho no código, mas nada funciona =~ É estranho porque o post tá lá, só não aparece na página principal. Mas quando eu clico nos comentários, que aí aparece 'a página do post', por assim dizer, ele tá lá, todo certinho. Não entendo :( Compartilhar este post Link para o post Compartilhar em outros sites
Anderson Narciso 3 Denunciar post Postado Setembro 2, 2010 Faça um backup desse seu index.php e coloque essa codificação no lugar <?php if (is_archive()) $post_number = get_option('personalpress_archivenum_posts'); if (is_search()) $post_number = get_option('personalpress_searchnum_posts'); if (is_tag()) $post_number = get_option('personalpress_tagnum_posts'); if (is_category()) $post_number = get_option('personalpress_catnum_posts'); if (is_home()) $args=array( 'showposts'=>get_option('personalpress_homepage_posts'), 'paged'=>$paged, 'category__not_in' => get_option('personalpress_exlcats_recent'), ); ?> <?php get_header(); ?> <?php global $query_string; if (is_category()) query_posts($query_string . "&showposts=$post_number&paged=$paged&cat=$cat"); elseif (is_home()) query_posts($args); else query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?> <div id="main"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $thumb = ''; $width = 175; $height = 175; $classtext = ''; $titletext = get_the_title(); $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext); $thumb = $thumbnail["thumb"]; ?> <?php global $post; $page_result = is_search() && ($post->post_type == 'page') ? true : false; ?> <div class="entry-wrap<?php if ($page_result) echo(' page_result'); ?>"> <div class="entry"> <h2 class="title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Link direto para %s', 'Anderson Narciso'), $titletext) ?>"><?php the_title(); ?></a></h2> <?php if (get_option('personalpress_postinfo1') <> '') { ?> <?php if ( in_array('date', get_option('personalpress_postinfo1')) ) { ?> <p class="date"> <span class="month"><?php the_time('M'); ?></span> <span class="day"><?php the_time('d'); ?></span> </p> <?php }; ?> <?php }; ?> <div class="entry-content clearfix"> <?php if($thumb <> '' && get_option('personalpress_thumbnails_index') == 'on') { ?> <div class="thumb"> <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?> <a href="<?php the_permalink() ?>" title="<?php printf(__('Link direto para %s', 'Anderson Narciso'), $titletext) ?>"><span class="overlay"></span></a> </div> <!-- end .thumb --> <?php }; ?> <?php if (get_option('personalpress_blog_style') == 'on') the_content(""); else { ?> <p><?php truncate_post(370); ?></p> <?php }; ?> <a href="<?php the_permalink() ?>" title="<?php printf(__('Link direto para %s', 'Anderson Narciso'), $titletext) ?>" class="readmore"><span><?php _e('Leia Mais','PersonalPress'); ?></span></a> </div> <!-- end .entry-content --> <div class="post-meta-top"></div> <div class="post-meta clearfix"> <?php if (get_option('personalpress_postinfo1') <> '') { ?> <?php if ( in_array('author', get_option('personalpress_postinfo1')) || in_array('comments', get_option('personalpress_postinfo1')) || in_array('categories', get_option('personalpress_postinfo1')) ) { ?> <?php if ( in_array('author', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info author"> <span class="right-sep"> <?php the_author_posts_link(); ?> </span> </span> <?php }; ?> <?php if ( in_array('comments', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info comments-number"> <span class="right-sep"> <?php comments_popup_link(__('0 comentários','PersonalPress'), __('1 comentário','PersonalPress'), '% '.__('comentários','PersonalPress')); ?> </span> </span> <?php }; ?> <?php if ( in_array('categories', get_option('personalpress_postinfo1')) ) { ?> <span class="meta-info categories"> <span class="right-sep"> <?php the_category(', ') ?> </span> </span> <?php }; ?> <?php }; ?> <?php }; ?> </div> <!-- end .post-meta --> </div> <!-- end .entry --> </div> <!-- end .entry-wrap --> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <?php include(TEMPLATEPATH . '/includes/navigation.php'); ?> <?php } ?> <?php else : ?> <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?> <?php endif; wp_reset_query(); ?> </div> <!-- end #main --> <?php get_sidebar(); ?> <?php get_footer(); ?> É do mesmo tema, só que no meu caso ele funciona http://www.andersonnarciso.com Compartilhar este post Link para o post Compartilhar em outros sites
marypaixao 0 Denunciar post Postado Setembro 2, 2010 Opa! Agora eu consegui! *_* Tive que fazer duas modificações: uma na linha 27, a linha toda tava dando erro; e outra na linha 56, a que você disse antes pra botar uma "?", mas que não funcionava. Mas de resto funcionou, YEY! Muitíssimo obrigada! *______________* Já tava um caco tentando ajeitar isso há dias! Bem, agora o post tá aparecendo lindamente na página principal (obrigada de novo, Anderson!), mas ele tá com aquela opção de "Ler mais", sabe? Não gosto daquilo e queria tirar, pro post todo aparecer na página principal, e só aparecer aquilo se eu configurar enquanto estiver fazendo o post. Como é que tira aquilo? (Muito obrigada novamente, Anderson! ^^) Compartilhar este post Link para o post Compartilhar em outros sites
marypaixao 0 Denunciar post Postado Setembro 2, 2010 Então, agora que percebi... Que o problema não foi de todo resolvido D= Tipo, agora aparece o título do post e o botão de "Leia Mais", mas o post em si não aparece na página principal. O_O E agora? D= Compartilhar este post Link para o post Compartilhar em outros sites