WordPress.org

Ready to get started?Download WordPress

Forums

Nivoslider Plugin -using all the post images in the cat setting (1 post)

  1. pulsamerica
    Member
    Posted 1 year ago #

    Hello,

    Using the Nivo Slider plugin in 'category' more, the plugin currently only uses featured images from each post.

    I was wondering how one might change the code below to use all the images from each post.

    Any thoughts most gratefully received!

    Ben

    if($_POST['slider_type'] == 'category'){
    $args = array(
    'post_type' => 'post',
    'numberposts' => -1,
    'category' => $_POST['category']
    );
    $posts = get_posts( $args );
    if( $posts ){
    foreach( $posts as $post ){
    if( has_post_thumbnail($post->ID) ) {
    $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
    $images[] = array(
    'id' => get_post_thumbnail_id($post->ID),
    'src' => $image[0]

Topic Closed

This topic has been closed to new replies.

About this Topic