网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > ZenCart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 153.99.80.189
Old 2016-08-17, 04:31 PM
Macks Creek Macks Creek is offline
初级会员
 
Join Date: 2012-02-09
Posts: 1
Macks Creek 现在声名狼藉
Default zencart调用wordpress

调用最新4篇Blog文章
<?php require('./wordpress所在目录/wp-blog-header.php'); ?>
<?php
$rand_posts = get_posts('numberposts=4&orderby=post_date');
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /><?php echo substr($post->post_content,0,200).'...';?></li>
<?php endforeach; ?>
Reply With Quote
  #2   IP: 153.99.80.189
Old 2016-08-17, 04:33 PM
Madalyn Madalyn is offline
初级会员
 
Join Date: 2007-02-07
Posts: 1
Madalyn 现在声名狼藉
Default

Code:
    <!--  BOF Load Wordpress -->
    <div class="sidebox-header-right "><h3 class="rightBoxHeading " id="Notification">Service Notification</h3></div>
    <div id="bestsellersContent" class="sideBoxContent">
    <div class="wrapper">
    <?php require('./blog/wp-blog-header.php'); ?>
    <?php
    $rand_posts = get_posts('numberposts=3&orderby=post_date');
    foreach( $rand_posts as $post ) :
    ?>
    <a href="<?php the_permalink(); ?>"><font color="red"><?php the_title(); ?></font></a><HR align=center width=95% color=#987cb9 SIZE=1>
    <?php endforeach; ?>
    </div>
    </div>
    <!-- EOF Load Wordpress -->
这个你可以参考以下,是我自己用的。
numberposts=3&orderby=post_date 其中3代表要调用文章数目
内容太长了我不想调用了

以上部分代码放在 ../common/tpl_mail_page.php里
<div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>">
下面
那显示的结果就是右侧栏最上面
Reply With Quote
  #3   IP: 153.99.80.189
Old 2016-08-17, 04:34 PM
Madison Lake Madison Lake is offline
初级会员
 
Join Date: 2005-11-28
Posts: 1
Madison Lake 现在声名狼藉
Default

产品页面调用WordPress最新文章 已解决
把WordPress安装到zen-cart一个子目录里吧,设置好固定连接等
这个文件/includes/templates/template_default/templates/tpl_product_info_display.php在合适的地方加入下面两行代码

<?php require('../wordpress所在目录/wp-blog-header.php'); ?> 这行调用WordPress自带函数,目录地址要随着WordPress安装目录变化而变化
<?php get_archives('postbypost', 10); ?> 这里的10指调用的最新文章数量
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:45 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.