Home Support Advanced post slider Offset from php query?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #506

    Hello!

    First: kudos. Love the plugin.

    Got a question. I’m building something for a client with your slider on the menu page.

    http://www.test1.websitehebben.com/menu/

    this features a quote for each month of the year. I’d like to create a custom offset, so the slider always begins with the quote for the current month. Im am using slider template 1, and would like to tap into your ‘offset’ field.

    Any thoughts?

    tnx!

    Janco

    #509
    Digonto Ahsan
    Keymaster

    You need to modify plugin file though its not recommended as your modification will be gone if you update the plugin later. If you need then try following solution.

    Open ‘advanced-post-slider.php’ from plugin folder, go to line no around 313 and look for the line $template = $res1[0]->template;

    Then paste the following line of code just above the previously mentioned line of code.

    $query_arg['date_query'] = array( array( 'year' => date('Y'), 'month' => date('n') ) );

    After adding the line it should look like the following screenshot.

    Advanced post slider date query

    #510

    Works!!!!

    Thank you very very much.

    Don’t worry about updates: this project will only last a year, so I don’t need this site to be online forever.

    Thanks again!

    Janco

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.