Disregard this, I was looking at the “text” tab of the wysiwyg, rather than the “visual”. My (incredibly stupid) mistake.
After more Googling around, I found this:
I already had something similar in my functions.php, but it obviously wasn’t quite right. This is the correct code:
//Include CPT In Categories Pages
function namespace_add_custom_types( $query ) {
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$post_types = get_post_types( '', 'names' );
$query->set( 'post_type', $post_types);
return $query;
}
}
add_filter( 'pre_get_posts', 'namespace_add_custom_types');
Still, respect for the help ractoon!
Still nothing, weirdly it doesn’t fire anything from within that init function. Maybe that only works in functions.php?
After some searching I found this post: http://support.advancedcustomfields.com/forums/topic/repeater-on-options-page-returns-count/
Which doesn’t directly apply to me as the code isn’t in functions.php, but it does imply that the repeater field “is not yet loaded and can’t run it’s custom load_value logic”.
I made the category page template in question (category-music.php) after installing ACF and creating the fields, do I have to register the new templates somehow?
Thanks for the reply, I updated the syntax, still works on homepage.php but not category.php
Weirdly when I dump the video_slider field on the category page I get this:
string(1) "2"
the “2” bit seems to be a count of the array, when there are three rows the dump updates to:
string(1) "3"
When I run the same dump code on homepage.php it returns the data correctly.
I seem to be able to get other standard text option fields on category.php, maybe it’s a combination of it being an option and a repeater field?
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.