Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #4188

    Is it possible to place static Pages in the “Featured Slider” rather than posts?

    #45361

    Hey,

    in index.php replace:

    $additional_loop = new WP_Query("cat=".$k_option['mainpage']['feature_cats_final']."&posts_per_page=".$k_option['mainpage']['feature_count']);

    with:

    $additional_loop =  new WP_Query(array('post_type' => 'page', 'post__in' => array(37,50)));

    Instead of 91, 71 insert the ids of the pages you want to display….

    #45362

    Either way doesn’t work www. moxiemaxwell .com

    #45363

    Hey,

    I adjusted the code above a bit. Please try it again.

    #45364

    how do I find out what number the post is?

    Also, when I do the featured image, it is doubleing in the post please look at moxiemaxwell .com

    #45365

    Hey,

    1)login in and go to the page you want to add to the slider. Click on “Edit Page” in the top wordpress admin bar. You’ll see that the url of the page editor contains a number (like http://localhost/wp-admin/post.php?post=50&action=edit ) – i.e. this page has the id 50. Note the id and then insert them seperated with commas.

    $additional_loop =  new WP_Query(array('post_type' => 'page', 'post__in' => array(37,50)));

    2) You inserted the image directly into your post too. You have 2 options:

    a) Remove the second image by deleting it from the post content

    b) Remove the featured image from the post content – open up single.php and delete:

    <?php
    if($preview_image)
    {
    echo '<div class="entry-previewimage rounded preloading_background">';
    echo $preview_image;
    echo '</div>';
    }

    ?>

    #45366

    I have tried this as outlined a few times. The site is working fine with calling the last 5 published posts.

    Step 1 remove;

    $additional_loop = new WP_Query("cat=".$k_option['mainpage']['feature_cats_final']."&posts_per_page=".$k_option['mainpage']['feature_count']);

    from index.php

    Step 2 replace with;

    $additional_loop = new WP_Query('page_id=39,57,73,276,44');

    In my case those are the pages I would like to use in the slider, for now, we will change them from time to time.

    What happens is the first featured image comes up, no other images come up. I am going to leave this up so you can take a look. http://VisitLondonderry.com

    #45367

    Hey,

    I adjusted the instructions above a bit. It should work correctly now. I didn’t use an array for the query first.

    #45368

    That made progress, however it results in only three page sliders showing. Even though five have been entered. For example.

    $additional_loop = new WP_Query(array('post_type' => 'page', 'post__in' => array(50,51,52,53,54)));

    With this setting only 51, 52, 53 show. The configuration menu in “mainpage options” is set to “5″ sliders. Setting it to “7″ sliders, we still only get 3.

    #45369

    Try following:

    $additional_loop = new WP_Query(array('post_type' => 'page','posts_per_page' => 5, 'post__in' => array(50,51,52,53,54)));

    #45370

    Thank you that worked! I would recommend you make a sticky of this or set up a clear post, I have seen a lot of people that have bought the theme looking for this option.

    Also if you could consider in the next update of the template adding this option to the dashboard. Providing boxes to enter the posts and or pages by number so editing the code is not required. You could have a selection of “the last X (3-7) posts” or “enter your post or page number.

    Thank you for the help my people here will be very happy today.

    #45371

    Glad that I could help you :) – I’ll post a tutorial in the general questions section.

    #45372

    I am using friendly url’s for my page names, so I don’t know how to find the page id

    #45373

    Login and go to the page you want to add to the slider. Click on “Edit Page” in the top wordpress admin bar. You’ll see that the url of the page editor contains a number (like http://localhost/wp-admin/post.php?post=50&action=edit ) – i.e. this page has the id 50.

    #45374

    Hello,

    the solution is working for me, except one thing: I cannot rearrange the order of the pages in the slider. Whatever I do, the page created the last time (nr 42) is at the first place and the oldest one (nr 10) is the last one in the slider. How can I rearrange this order? Temporary address: http://fenyves-taborhu.web-server.hu/

    Thanks a lot!

    Katalin

    #45375

    Hey,

    The order of pages is defined by the order in which they are called in the WP_Query – in Dude’s latest example code above the posts called are: 50,51,52,53,54

    So changing the order to: 54,50,51,52,53 would load the page with the ID of 54 1st.

    James

    #45376

    Unfortunately, it’s not the case at my temporary site: http://fenyves-taborhu.web-server.hu/ . The array in this moment is (10,13,15,42) –> the first slide should be 10, but instead it’s 42. Whatever I change in this array, it won’t affect anything in the slider. Please help me to rearrange the slides in the array of 10,13,15,42… Thanks a lot!

    #45377

    I don’t think it’s possible to short the array by ids. You can only change the publishing date to effect the order.

    #45378

    Yes, changing the dates is a working solution! Thanks a lot!

    #45379

    Great, glad that it works now :)

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

The topic ‘Featured Slider – Pages ?’ is closed to new replies.