Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

#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
Código: Selecionar todos
<?php define('WP_USE_THEMES', false);
require($_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-blog-header.php');
query_posts('showposts=5');
?>
feito isso, pode fecha o index.php, soh iremos mecher isso


agora vá em catalog\view\theme\default\template\common\home.tpl
encontre
Código: Selecionar todos
  <?php } ?>
  <?php foreach ($modules as $module) { ?>
  <?php echo ${$module['code']}; ?>
  <?php } ?>
abaixo disto, adicone
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(' &bull; '); ?></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
/*------ 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 ------*/
as img ali em são: http://baixa.la/arquivo/6093270 e http://baixa.la/arquivo/9100803




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.
#664
@Nyux

o wordpress são codigos livres, então mais facil muda, o blogpost ja é um serviço gratis, sem alteração extrema no code

mais tudo é possivel criar, mais como eu nao uso ele, então nao procurei fazer nada algo parecido


-------------------

@Anderson Narciso

então, eu ainda estou a termina o meu site, e pretendo criar isso tbm pro meu, quando tiver pronto, eu coloco no forum
#31442
Cara, usava esse mesmo metodo pra aplicar o wordpress ao opencart, nas versoes anteriores e era tudo belezinha.. porém nestas novas 1.5 X volta e meia da erro:

Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time in /home/public_html/shop/vqmod/vqcache/vq2-system_startup.php on line 13
Notice: A session had already been started - ignoring session_start() in /home/public_html/shop/vqmod/vqcache/vq2-system_startup.php on line 16
Fatal error: Cannot redeclare class Cart in /home/public_html/shop/system/library/cart.php on line 2
#37566
integrei com o OC 1.5.5.1 e funcionou..

alguns ajustes como trocar a funcao is_a

// if ( is_object($thing) && is_a($thing, 'WP_Error') )
if ( is_object($thing) && ($thing instanceof WP_Error) )

dos arquivos do WP.. mas no final deu tudo certo..
Erro ao acessar ADMIN

Procure por erros, exceções ou infor[…]

Tradução não funciona

Olá, @Top Arts Digital ! Tudo bem? A vers&[…]

Alterações Como Fazer?

Ola @KingKong Acesse o codigo do bloco e fa&cce[…]

Estou com um problema também na Integra&cce[…]