• Resolved foleyfactor

    (@foleyfactor)


    Hello, I am trying to have a “featured post” on the front page of my website, using the mesocolumn theme. I want to do this by having just the most recent post from a single category show in the slider. The slider does break with only one post in it (which I have read from previous postings), but I was wondering if there was a way to “trick” the slider into thinking that it has two posts, even though they are the same (ideally without specifying the post id every time we want to change it).

    In addition, there’s one more thing I’m looking to do: on the front page, where it displays the category’s most recent posts, is there a way to have it display the second most recent post without also displaying the most recent? I know you can have 2 posts per category, but is there a way to have it skip the most recent and go straight to the second most recent?

    Thanks for all of your help!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Richie KS

    (@rkcorp)

    1. you could by entering 2 of the same id like 5,5 inside the post id textfield.

    2. open lib/templates/home-feat-cat.php, search for all this code ‘offset=’ and replace it with ‘offset=1’

    it will offset 1 post from the latest.

    Thread Starter foleyfactor

    (@foleyfactor)

    Thanks Richie, the second fix worked like a charm! I had read elsewhere that putting the same post id twice would work, but I was wondering if there was a way to do it with just a category… It seems like a pain to have to change that post id everytime we want to change the slider. I will try to play around with the slider and see if I can get anything to work, Is there anything you recommend?

    Thread Starter foleyfactor

    (@foleyfactor)

    Do you know if it would be possible to change the category loop to always iterate over the most recent post? I think if it was possible to not iterate all of the posts, but rather just the same post in this loop:
    while ( $query->have_posts() ) : $query->the_post(); ?>
    However, changing it to something like while ( $query->have_posts() ) : $query->get_posts()[0]; ?> creates an infinite loop from what I can tell.

    If you can figure out a way, it would be greatly appreciated. If not, I guess we will just have to update the id manually.

    Thread Starter foleyfactor

    (@foleyfactor)

    An update: I have gotten it to take just one post from a category of my choosing, which I am very happy with.

    Does anyone know how to change the delay between slides on the slider? I have tried editing them in jd.gallery.v2.js, to no avail, so I think that I need to change something where the slider is initialized in the theme, but I cannot find this. I have also looked in jd-gallery-slider.php, and checked through many of the theme files in the editor.

    Again, all of your help is greatly appreciated!

    Theme Author Richie KS

    (@rkcorp)

    it should work on the jd.gallery.v2.js, look for

    var gallery = {
    	initialize: function(element, options) {
    		this.setOptions({
    			showArrows: true,
    			showCarousel: true,
    			showInfopane: true,
    			embedLinks: true,
    			fadeDuration: 500,
    			timed: false,
    			delay: 9000,

    the delay i think..

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘One Image/Post in Slider’ is closed to new replies.