Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #6293

    In this support thread in the general section, you describe how to use pages in the slider instead of posts.

    http://www.kriesi.at/support/topic/how-to-use-pages-instead-of-posts-for-the-newscast-slider

    Is it one or the other, but never posts and pages combined?

    Just need the clarification, unless you have a code change to combine.

    Thank you.

    #53629

    Basically it should be possible to change:

    $additional_loop =  new WP_Query(array('post_type' => 'page', 'posts_per_page' => 5, 'post__in' => array(37,50,54,30,32)));

    to:

    $additional_loop =  new WP_Query(array('post_type' => array( 'post', 'page' ), 'posts_per_page' => 5, 'post__in' => array(37,50,54,30,32)));

    - you’d query posts and pages then. However the post__in parameter needs post & page ids then. For all query parameters/combinations refer to: http://codex.wordpress.org/Class_Reference/WP_Query

    #53630

    Installed the code and it works, somewhat. I have three posts and one page. The code change supplied above shows (in the slider) ONE post and the specified numbered page. What happened to the other two posts?

    Here is the current code:

    <!– FEATURED POST AREA ################################################### –>

    <div id=”feature_wrap”>

    <!– ###################################################################### –>

    <div id=”featured” class='<?php echo $k_option; ?>’>

    <?php

    //check slider and apply size to previe images

    $kimg = array(‘shortcut’ => ‘L’, ‘overwrite’ => ‘none’);

    if($k_option == ‘fadeslider’)

    {

    $kimg = array(‘shortcut’ => ‘XL’, ‘overwrite’ => ‘none’);

    }

    // start the loop that gernerates the images

    $loopcount = 1;

    $additional_loop = new WP_Query(array(‘post_type’ => array( ‘post’, ‘page’ ), ‘posts_per_page’ => 5, ‘post__in’ => array(137)));

    if ($additional_loop->have_posts()) :

    while ($additional_loop->have_posts()) : $additional_loop->the_post();

    #53631

    Here’s a related problem to the above. When I assign a Featured Image to the PAGE for display in the slider, by default, that same image is displayed full width of the content area on the page when it is displayed. However, since the full width of the page is wider than the image, the image distorts horizontally about 30% too long. How can the display of the Featured Image in the generated PAGE viewed be keep to correct proportions?

    Thank you

    #53632

    Also thinking it would be nice to have more control over the display of Featured Image on the PAGE itself. Ability to resize, turn off, etc. That might happen in the dialogue box when you initially import the image, but is there any kind of sizing and on-off control after import?

    #53633

    Another addition to the above…

    I am working on a page as per previous instructions: template_blog.php

    Below is what looks like the code that controls the photo display? What do I need to change to eliminate the photo at the top of the page or have some control over its size and proportion?

    // ############################# FULL SIZED POSTS #############################

    if ($fullsized > 0) :

    $preview_image = kriesi_post_thumb($post->ID, array(‘size’=> array(‘M’),

    ‘display_link’ => ‘_prev_image_link’,

    ‘linkurl’ => array (‘L’,’_preview_big’),

    ‘wh’ => $k_option

    ));

    ?>

    <div class=”entry <?php if(!$preview_image) echo ‘entry-no-pic';?>”>

    <?php

    if($preview_image)

    {

    echo ‘<div class=”entry-previewimage rounded preloading_background”>';

    echo $preview_image;

    echo ‘</div>';

    }

    ?>

    #53634

    Hey,

    it’s not easily possible to use different thumbnails for slider & single entries. You can adjust the thumbnail dimensions in function.php though (however WordPress center crops all images and Newscadt doesn’t over an overwrite option).

    You can remove the featured images on the blog page by deleting following line:

    echo $preview_image;

    You can resize the images by changing the thumbnail dimensions in functions.php – afterwards you need to regenerate the thumbnails with: wordpress.org/extend/plugins/regenerate-thumbnails/

    Maybe you need to adjust the preview image width via css code too – add following code to style.css and adjust the width/height value:

    .entry-previewimage, .entry-previewimage a {
    height: 180px;
    width: 180px;
    }

    #53635

    Hello and thanks.

    Still need some guidance on the issue in the third post in this thread, the one that starts with:

    “Installed the code and it works, somewhat. I have three posts and one page. The code change supplied above shows (in the slider) ONE post and the specified numbered page. What happened to the other two posts?”

    Yes, what did happen to the two missing test posts?

    #53636

    Tried deleting echo $preview_image; in:

    template_blog.php

    But that change did NOT remove the full width image at the top of the page.

    Is there something else that might do it?

    #53637

    I might also be able to go this direction… working with template_fullwidth.php

    What code would I alter here to eliminate the full width preview photo at the top of the page?

    <?php

    /*

    Template Name: Full Width

    */

    $k_option = “fullwidth”; //$k_option = “”;

    get_header();

    $preview_image = kriesi_post_thumb($post->ID, array(‘size’=> array(‘XL’,’_preview_big’),

    ‘display_link’ => ‘_prev_image_link’,

    ‘linkurl’ => array (‘fullsize’),

    ‘wh’ => $k_option

    ));

    if($preview_image)

    {

    echo “<!– ###################################################################### –>”;

    echo “<div id=’feature_wrap’>”;

    echo “<!– ###################################################################### –>”;

    echo “<div id=’featured’ class=’fadeslider’>”;

    echo “<div class=’featured featured1′>”;

    echo $preview_image;

    echo “</div><!– end .featured –>”;

    echo “</div><!– end #featured –>”;

    echo “<span class=’bottom_right_rounded_corner ie6fix’></span>”;

    echo “<span class=’bottom_left_rounded_corner ie6fix’></span>”;

    echo “<!– ###################################################################### –>”;

    echo “</div><!– end featuredwrap –>”;

    echo “<!– ###################################################################### –>”;

    }

    ?>

    #53638

    Partial solution to one of the above problems. On the code to include BOTH posts and pages in the slider, it was showing only one of three test posts, and the only specified numbered page.

    I found it I made all the posts for the sliders STICKIES, they would all appear. And the numbered page still appears, so workaround was successful. I can live with it.

    Now just need a way to delete the full width preview image from the top of any template page in the page view.??????

    Thanks

    #53639

    Once again, tried deleting:

    echo $preview_image;

    on the template_fullwidth.php page

    and the result is when the page appears, where there should be the preview image, there is a box with a little pinwheel spinning round and round. Instead of there NOT being an image (the result I want in the page view), there is the little pinwheel.

    Frustrating.

    #53640

    OK…after several hours have solved the problem…

    In the template_fullwidth.php file, delete everything between these two lines:

    echo “<div id=’feature_wrap’>”;

    echo “</div><!– end featuredwrap –>”;

    Not sure that is 100% correct coding, but it works. The distorted top preview photo is gone from the page view, while the Featured Image still appears in the slider, correctly linked to the page.

    This is the correct formatting of the code to include both posts and pages in the slider:

    $additional_loop = new WP_Query(array(‘post_type’ => array( ‘post’, ‘page’ ), ‘posts_per_page’ => 5, ‘post__in’ => array(37,50,54,30,32)));

    As noted by Dude, the array numbers at the end of the line represent the numbers of your page. Change the order of the numbers to change the order of display in the slider.

    I found that you need to make any posts that you want to appear in the slider Stickies, otherwise they won’t show up. Don’t know why, but that is what is needed.

    I can now use template_fullwidth.php as the base template for a page that can be used similar to desktop publishing especially when used with WP-Table Reloaded plugin. And any selected page can be linked from the Slider, with the Featured Image displayed.

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘Pages instead of posts in slider, but how about both?’ is closed to new replies.