Support » Plugin: Recent Posts Widget With Thumbnails » Adding Offset -1 to wpquery

  • Resolved dustyhope

    (@dustyhope)


    Hi LOVE LOVE LOVE this plugin. Am using it on a clients site. But I needed for it to skip first post — just on Home Post Page — so far I have dug into your wonderful plug, and added offset -1 to the basic wpquery args (directly on your php page). Now I have to figure out how to add a conditional for home page only – and how at this point to hook/patch it in from the function page. Just wanted to let you know I am trying to figure out a specific little patch to do this — THANKs again for this wonderful plugin. yours dusty

Viewing 1 replies (of 1 total)
  • Plugin Author Martin Stehle

    (@hinjiriyo)

    Thank you for your feedback! An approach for your issue can be:

    function rpwwt_add_offset_on_homepage ( $args ) {
    	if ( is_home() or is_frontpage() ) {
    		$args['offset'] = 1;
    	}
    	return $args;
    }
    add_filter( 'rpwwt_widget_posts_args', 'rpwwt_add_offset_on_homepage' );

    I did not test the code, but I am sure it works. Do not add it in the plugin. Add it in the functions.php of your theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Offset -1 to wpquery’ is closed to new replies.