Hello I wanna ask if it’s possible to query post or custom post type depending on the text field value?
for example i have a Page template called “Loop Posts Template” that I want it dynamically loop the posts but In the page editor I have a blank text field that if I enter the category or taxonomy name, what’s going to show in the template is the loop of the category or taxonomy that I entered.. please help me.
Hi @slash_1968
This is possible both with this plugin and default wordpress theme customizer
You should add following codes before the loop. The 1st example is for theme customizer and the 2nd is for this plugin.
<?php
$category_slug = get_theme_mod( 'your_field_id' );
query_posts( array ( 'category_name' => $category_slug ) );
?>
———
<?php
$category_slug = get_field( 'your_field_id' );
query_posts( array ( 'category_name' => $category_slug ) );
?>