我有一个HTML主题,并希望将其转换为wordpress主题, 此主题中的项目部分将显示帖子并具有特殊结构, 我的问题是写一个php& wordpress功能可以显示相同的外观,也可以从管理面板发布,即使其动态化 为了解决问题,请查看包含html主题的附件link,我认为可以通过while循环完成。有人可以帮我写这篇文章。
这是项目部分代码,我们想把它变成一个PHP代码:
<div id="home-presentation" class="custom-scroll">
<div class="list">
<div class="box">
<div class="fly first">
<h4><a href="portfolio.html">Projects</a></h4>
</div>
<div class="el_3 pos_3 fly big color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/10/presentation.jpg" alt="backgrounds" >
<span>
backgrounds
</span>
<ins></ins>
</a>
</div>
<div class="el_3 pos_7 fly without-image color_1">
<div class="project">
<span class="arrow top"> </span><h5><a href="javascript:;">backgrounds</a></h5>
<p>Project: backgrounds</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_5 pos_8 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/60/presentation.jpg" alt="last one" >
<span>
and last
</span>
<ins></ins>
</a>
</div>
</div>
<div class="box">
<div class="el_8 pos_1 fly big color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/58/presentation.jpg" alt="customer 3" >
<span>
customer 3
</span>
<ins></ins>
</a>
</div>
<div class="el_6 pos_5 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/54/presentation.jpg" alt="customer 1" >
<span>
customer 1
</span>
<ins></ins>
</a>
</div>
<div class="el_6 pos_6 fly without-image color_3">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">customer 1</a></h5>
<p>Project: customer 1</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_5 pos_7 fly without-image color_3">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">last one</a></h5>
<p>Project: last one</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_9 pos_8 fly without-image color_1">
<div class="project">
<span class="arrow right"> </span><h5><a href="javascript:;">customer 4</a></h5>
<p>Project: customer 4</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
</div>
<div class="box">
<div class="el_8 pos_1 fly without-image color_1">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">customer 3</a></h5>
<p>Project: customer 3</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_7 pos_2 fly without-image color_3">
<div class="project">
<span class="arrow right"> </span><h5><a href="javascript:;">customer 2</a></h5>
<p>Project: customer 2</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_10 pos_3 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/63/presentation.jpg" alt="customer 5" >
<span>
customer 5
</span>
<ins></ins>
</a>
</div>
<div class="el_10 pos_4 fly without-image color_1">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">customer 5</a></h5>
<p>Project: customer 5</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_9 pos_5 fly big color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/62/presentation.jpg" alt="customer 4" >
<span>
customer 4
</span>
<ins></ins>
</a>
</div>
</div>
<div class="box">
<div class="el_7 pos_1 fly big color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/65/presentation.jpg" alt="customer 2" >
<span>
customer 2
</span>
<ins></ins>
</a>
</div>
<div class="el_4 pos_5 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/48/presentation.jpg" alt="free and safe" >
<span>
free and safe
</span>
<ins></ins>
</a>
</div>
<div class="el_4 pos_6 fly without-image color_3">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">free and safe</a></h5>
<p>Project: free and safe</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_5 pos_7 fly without-image color_3">
<div class="project">
<span class="arrow right"> </span><h5><a href="javascript:;">last one</a></h5>
<p>Project: last one</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_5 pos_8 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/50/presentation.jpg" alt="last one" >
<span>
last one
</span>
<ins></ins>
</a>
</div>
</div>
<div class="box">
<div class="fly last">
<p><a href="http://dev.creativex.bg/svn/vladi/CreativeX/bg/portfolio/">Всички</a></p>
<h6><a href="http://dev.creativex.bg/svn/vladi/CreativeX/bg/portfolio/"><span>453</span>Projectа</a></h6>
</div>
<div class="el_3 pos_1 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/46/presentation.jpg" alt="backgrounds" >
<span>
background image
</span>
<ins></ins>
</a>
</div>
<div class="el_3 pos_2 fly without-image color_1">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">backgrounds</a></h5>
<p>Project: background image</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_2 pos_3 fly without-image color_1">
<div class="project">
<span class="arrow right"> </span><h5><a href="javascript:;">test 2</a></h5>
<p>Project: test 2</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
<div class="el_2 pos_4 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/70/presentation.jpg" alt="test 2" >
<span>
test 2
</span>
<ins></ins>
</a>
</div>
<div class="el_1 pos_5 fly color_1">
<a href="portfolio_view.html" class="image">
<img src="images/temp/presentations/71/presentation.jpg" alt="testovi danni" >
<span>
testovi danni
</span>
<ins></ins>
</a>
</div>
<div class="el_1 pos_6 fly without-image color_3">
<div class="project">
<span class="arrow left"> </span><h5><a href="javascript:;">testovi danni</a></h5>
<p>Project: testovi danni</p>
<a href="portfolio_view.html" class="details" title="view details">view details</a>
<a href="portfolio_view.html" class="live" title="go live">go live</a>
</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
<?php $vik=1 query_post('showposts');
while(have_posts()): the_post();
?>
<li class="test<?php echo $vik; ?>">
<?php the_title();
the_content()
the_permalink();
?>
</li>
<?php
$vik++;
endwhile; wp_reset_query(); ?>
尝试使用以下内容或遵循wordpress codex功能规则希望这可以帮助您制作动态帖子