我正在把一个单页面的html站点转换成一个静态的wordpress站点。最初的html主页(唯一的页面)主要是使用jquery在点击远菜单中的一个选项时下拉一个小的文本区。附上我转换的主题的index.php。
<div class="content" id="content1">
<a href="" onclick="deanimate('content1')"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/close.png" style="position:absolute; right:5px; top:5px; width:15px;"/></a>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/face.png" style="padding-left:15px; padding-top:20px; width:454px;" />
</div>
<div class="content" id="content2">
<a href="" onclick="deanimate()"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/close.png" style="position:absolute; right:5px; top:5px; width:15px;"/></a>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/face2.png" style="padding-right:15px; padding-top:30px; width:453px; height:200px;" />
</div>以此类推..我想以这样的方式添加内容,这样我就可以在wordpress应用程序中修改它,而不需要编辑主题文件?有可能吗?wordpress新手。感谢您的帮助。
发布于 2013-02-11 21:26:18
可以,您可以从wp-admin编辑内容。在admin下的页面管理中,您可以创建页面,然后在page.php或模板文件中添加循环,它将显示您在admin中编写的内容。
<?php while ( have_posts() ) : the_post(); ?>
<?php the_title();?>
<?php the_content();?>
<?php endwhile;?>使用上面的代码,您可以在浏览器上显示页面管理内容。
https://stackoverflow.com/questions/14708860
复制相似问题