- 04 Out 2010, 15:34
#611
Adicionando o wordpress para exibir as ultimas materias no oc
vamos la
vá no arquivo index.php do opencart
na primeira linha, adiciona
no /wordpress/wp-blog-header.php é o diretorio onde ta istalado o seu wp
e o showposts=5' é quanto ultimos post q vcs quiser exibir
agora vá em catalog\view\theme\default\template\common\home.tpl
encontre
primeira parte ta feita
mais vá exibir só o conteudo simples, ai voces usem o css para modular
o meu css ta assim
isto em cima fica na home.
agora adicionar apenas o link no rodapé(fooder) pra fika em todas as pag
vá em catalog\view\theme\default\template\common\footer.tpl
e na parte q voces quiser na fooder adicona
bom, terminado.
vamos la
vá no arquivo index.php do opencart
na primeira linha, adiciona
no /wordpress/wp-blog-header.php é o diretorio onde ta istalado o seu wp
e o showposts=5' é quanto ultimos post q vcs quiser exibir
Código: Selecionar todos
feito isso, pode fecha o index.php, soh iremos mecher isso<?php define('WP_USE_THEMES', false);
require($_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-blog-header.php');
query_posts('showposts=5');
?>
agora vá em catalog\view\theme\default\template\common\home.tpl
encontre
Código: Selecionar todos
abaixo disto, adicone <?php } ?>
<?php foreach ($modules as $module) { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
Código: Selecionar todos
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="center">
<h1>Ultimas do Blog</h1>
</div>
</div>
<div class="middle">
<!-- Blog -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<div class="post-date">
<p class="day"><?php the_time('d/m/Y') ?></p>
</div>
<div class="post-info">
<p class="comments"><?php comments_popup_link('Nenhum comentário', '1 comentário', '% comentários', 'comments', 'Comentários estão desligados para este post'); ?></p>
<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>
<br>
<div class="entry">
<?php the_content('Leia Mais'); ?>
</div>
<br>
<p class="post-tags">Postado em <?php the_category(' • '); ?></p>
</div>
<?php endwhile; else: ?>
<p>Desculpe, não corresponde às suas postagens critérios</p>
<?php endif; ?>
<!-- Fim Blog -->
</div>
<div class="bottom">
<div class="left"></div>
<div class="right"></div>
<div class="center"></div>
</div>
primeira parte ta feita
mais vá exibir só o conteudo simples, ai voces usem o css para modular
o meu css ta assim
Código: Selecionar todos
as img ali em são: http://baixa.la/arquivo/6093270 e http://baixa.la/arquivo/9100803/*------ blog ------*/
.more-link{background-image:url("../image/icons.png");background-position:0 -338px;background-repeat:no-repeat;margin:2px 0;padding:5px 0 0 28px;}
.post-date{background:transparent url("../image/info-bar.png") no-repeat left -75px;float:left;font-weight:700;padding-left:11px;text-transform:uppercase;}
.post-date p.day{background:transparent url("../image/info-bar.png") no-repeat right -42px;color:#fff;height:33px;line-height:31px;margin:0;padding:0 16px 0 0;}
.post-info{background:transparent url("../image/info-bar.png") no-repeat right top;color:#bbb;height:42px;margin-left:11px;text-shadow:#fff 1px 1px 1px;}
.post-info a{color:#999;font-weight:700;}
.post-info a:hover{color:#ed1e24;}
.post-info p.comments{float:right;line-height:32px;margin:0 10px 0 0;}
.post-info p.comments a.comments{background-image:url("../image/icons.png");background-position:0 -360px;background-repeat:no-repeat;margin:2px 0;padding:4px 0 0 28px;}
.post-tags{background-image:url("../image/icons.png");background-position:0 -315px;background-repeat:no-repeat;margin:3px 0;padding:6px 0 0 28px;}
h2.title a{color:#4e4e4e;font-family:"Segoe UI";font-size:15px;margin-left:10px;position:relative;text-decoration:none;top:4px;}
h2.title a:hover{color:#ed1e24;text-decoration:none;border-bottom-width: 2px;border-bottom-style: dashed;border-bottom-color: #000;}
/*------ Fim blog ------*/
isto em cima fica na home.
agora adicionar apenas o link no rodapé(fooder) pra fika em todas as pag
vá em catalog\view\theme\default\template\common\footer.tpl
e na parte q voces quiser na fooder adicona
Código: Selecionar todos
<table width="70%" border="0">
<tr style="color:#FFFFFF;font-weight: bold;">
<td>Ultimas do Blog</td>
</tr>
<tr valign="baseline">
<td><ul><?php while (have_posts()): the_post(); ?><li><a target="_blank" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><?php endwhile; ?></ul></td>
</tr>
</table>
bom, terminado.
<php
// maxno ;D
if ($yourlove == true) {
while (isset($me)) {
$mylove = $mylove+1;
}
} else {
$me = null;
}
?>
// maxno ;D
if ($yourlove == true) {
while (isset($me)) {
$mylove = $mylove+1;
}
} else {
$me = null;
}
?>