简体   繁体   中英

Dynamic single page Wordpress

I have a single page in wordpress but it has 3 slides of text using orbit slider.Orbit slider works like this (one slide) :

 <li>
<div class="small-12 large-6 columns text">
<h1>Scelerisque urna!</h1>
<img class="line" src="img/small-line.png">
<p>Urna turpis dictumst porttitor amet scelerisque</p>

<p>Phasellus nec ultricies risus</p>
</div>
<div class="small-12 large-6 columns"><img src="img/car.jpg"></div>
 </li>

so one slide is in one <li></li> . How can i make a new post, then in there have a option like "Add new slide" so a new text editor appears or something where the user can put an image and text for the second slide and if he wants add a new slide ?

one slide : http://pokit.org/get/?666cf2d698a981e7cb0605fa7c2ca782.jpg

second slide : http://pokit.org/get/?591d6f998229d24f1442ae0b635a0797.jpg

I forgot to say I want an option to add unlimited slides not only three

maybe it can be done with this plugin ?

http://wordpress.org/plugins/wp-anything-slider/screenshots/

Three ways of doing this:

  1. Use the post/page attachments as slides. Relevant WordPress function: get_children() . Pass the post/page ID and retrieve all image attachments. Loop through them and build your output.

  2. Use a custom meta box with repeatable uploading fields. Solution here in SO: Adding custom image fields and other fields at the same time . Relevant function: get_post_meta . Get the meta data and loop.

  3. Use a plugin to add repeatable uploading fields. Solution at WordPress Answers . Get the meta data with the plugin custom functions or with get_post_meta and loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM