July 20, 201214 yr I have been following a tutorial on wp.tutsplus.com on creating a slider for wordpress. I have managed to create it ok, but I wanted to add an editor to it to allow more text. Using the register_post_type tag I have added 'editor' to the list of options that it supports. The editor now appears in my Nivo slider option, but the text I write in the editor does not appear in the slider. I know that I have to add some code to this loop: function np_function($type='np_function') { $args = array('post_type' => 'np_images', 'posts_per_page' => 5); $result = '<div class="slider-wrapper theme-default">'; $result .= '<div id="slider" class="nivoSlider">'; //the loop $loop = new WP_Query($args); while ($loop->have_posts()) { $loop->the_post(); $the_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $type); $result .='<img title="'.get_the_title().'" src="' . $the_url[0] . '" data-thumb="' . $the_url[0] . '" alt=""/>'; } $result .= '</div>'; $result .='<div id = "htmlcaption" class = "nivo-html-caption">'; $result .='<strong>This</strong> is an example of a <em>HTML</em> caption with <a href = "#">a link</a>.'; $result .='</div>'; $result .='</div>'; return $result; } , but I don't know where to put it or what the code should be. Can anyone help? Thanks.
Create an account or sign in to comment