Tagged: x
-
AuthorPosts
-
September 15, 2016 at 12:50 pm #1176955
davidhellminParticipanti am working on a site for my girlfriend and have come to a stop.
I fetch all the blog entries (posts) with the grid, but some of them aren´t supposed to be queried. I will query these entries seperatly on another page.EDIT:
I am almost there. Added this so the child themes functions.php, but one post still remains.function my_query_args($query_args, $grid_name) { if ($grid_name == 'Senaste nytt') { // all query parameters can be modified (https://codex.wordpress.org/Class_Reference/WP_Query) //$query_args['posts_per_page'] = 2; $query_args = new WP_Query( 'cat=-11' ); } return $query_args; } add_filter('tg_wp_query_args', 'my_query_args', 10, 2);EDIT 2:
Solved it by adding:
$query_args['cat'] = -11;Still woundering what the 10 and 2 represent in the last row?
September 15, 2016 at 2:08 pm #1177075
RahulModeratorGlad you’ve sorted it out!
Let us know if we can help with anything else.
Thanks.
September 16, 2016 at 9:14 am #1178214
davidhellminParticipantadd_filter('tg_wp_query_args', 'my_query_args', 10, 2);
Still woundering what the 10 and 2 represent in this row?September 16, 2016 at 5:42 pm #1178719
DarshanaModeratorHi there,
Those two values represents priority and the number of parameters accepted by the function. For an example, you can refer to this (https://developer.wordpress.org/reference/functions/add_action/).
Thanks!
September 17, 2016 at 1:18 pm #1179529
davidhellminParticipantI see. Thank you for clearing that out 🙂
September 18, 2016 at 12:01 am #1179854
RadModeratorYou’re so much welcome!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1176955 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
