Pagination op static frontpage

Home » Oxygen Builder » Pagination op static frontpage

Heb je een statische homepage (pagina) en toon je daar via je oxygen template ook een repeater van posts, dan werkt de pagination helaas niet. Dat is overigens geen fout van Oxygen, maar een keuze van WordPress. Je kunt het wel oplossen. Maak voor de repeater een code block aan met de volgende php functie. Deze functie kun gebruiken in de advanced query van de repeater (zie JSON). Met dank aan https://www.great-tit.com/oxygen-repeater-pagination-not-working-on-homepage/

PHP

Copied
<?php // needed for pagination on static frontpage function fwp_get_paged() { if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) {$paged = get_query_var('page'); } else {$paged = 1;} return $paged; } ?>

Oxygen JSON

Copied
{"component":{"id":58,"name":"oxy_dynamic_list","options":{"ct_id":58,"ct_parent":44,"selector":"_dynamic_list-58-24","original":{"wp_query":"advanced","query_post_types":["post"],"paginate_prev_link_text":"Vorige","paginate_next_link_text":"Volgende","wp_query_advanced":[{"key":"post_type","values":[{"value":"post"}]},{"key":"posts_per_page","values":[{"value":"5"}]},{"key":"paged","values":[{"value":"[oxygen data='phpfunction' function='fwp_get_paged' ]"}]}],"wp_query_advanced_preset":"Custom Settings","query_taxonomies_any":[],"query_taxonomies_all":[],"query_authors":[],"paginatelink_padding_right":"10","paginatelink_padding_left":"10","paginate_end_size":"0","paginate_mid_size":"2","grid-column-count":"2","globalconditions":[{"name":"","operator":null,"value":"","searchValue":""}],"query_count":"6"},"activeselector":false,"nicename":"Repeater (#58)","ct_depth":4},"children":[{"id":59,"name":"ct_div_block","options":{"ct_id":59,"ct_parent":58,"selector":"div_block-59-24","original":{"margin-top":"0","margin-bottom":"30","display":"flex","flex-direction":"column","align-items":"flex-start"},"activeselector":false,"nicename":"Div (#59)","ct_depth":5},"children":[{"id":270,"name":"ct_link","options":{"ct_id":270,"ct_parent":59,"selector":"link-270-24","original":{"url":"[oxygen data='permalink' ]","flex-direction":"column","display":"flex","align-items":"flex-start","url_encoded":"true"},"nicename":"Link Wrapper (#270)","ct_depth":6},"children":[{"id":244,"name":"ct_text_block","options":{"ct_id":244,"ct_parent":270,"selector":"text_block-244-24","original":{"font-size":"14","color":"#727272"},"nicename":"Text (#244)","ct_depth":7,"ct_content":"<span id=\"ct-placeholder-245\"></span>"},"children":[{"id":245,"name":"ct_span","options":{"ct_id":245,"ct_parent":244,"selector":"span-245-24","nicename":"Span (#245)","original":{"color":"#898989"},"ct_depth":8,"ct_content":"[oxygen data='date' ]"},"depth":9}],"depth":8},{"id":236,"name":"ct_headline","options":{"ct_id":236,"ct_parent":270,"selector":"headline-236-24","original":{"tag":"h3","text-align":"left","color":"#727272"},"activeselector":false,"nicename":"Heading (#236)","hover":{"color":"#ff0000"},"ct_depth":7,"ct_content":"<span id=\"ct-placeholder-237\"></span>"},"children":[{"id":237,"name":"ct_span","options":{"ct_id":237,"ct_parent":236,"selector":"span-237-24","nicename":"Span (#237)","ct_depth":8,"ct_content":"[oxygen data='title' ]"},"depth":9}],"depth":8},{"id":276,"name":"ct_text_block","options":{"ct_id":276,"ct_parent":270,"selector":"text_block-276-24","original":{"text-align":"left"},"activeselector":false,"nicename":"Text (#276)","ct_depth":7,"ct_content":"<span id=\"ct-placeholder-240\"></span>"},"children":[{"id":240,"name":"ct_span","options":{"ct_id":240,"ct_parent":276,"selector":"span-240-24","nicename":"Span (#240)","ct_depth":8,"ct_content":"[oxygen data='excerpt' ]"},"depth":9}],"depth":8}],"depth":7}],"depth":6}],"depth":5},"classes":{}}
Stuur een berichtje

Contact

Wil je meer weten over de mogelijkheden voor jouw nieuwe website? Vul dan dit webformulier in. 

FORTE web publishing
Hartingstraat 254
3511 HV  UTRECHT
Tel: +31 30 743 56 68
E-mail: info@forte.nl

    © FORTE web publishing
    KvK: 08095495 | BTW: NL001406492B48