Home › Forums › General Issues › Loop Post depending on the textfield › Reply To: Loop Post depending on the textfield
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 ) );
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.