Support

Account

Home Forums Add-ons Repeater Field Show ACF in special categry page

Unread

Show ACF in special categry page

  • Hello
    Here is my thing:
    I developed a site where there are 2 types of categories:
    normal and “custom”
    most of the categories display normally like any other site showing
    the posts in the archive.php page
    and some posts archive are displaying in a special “category” template which I created which is styled differently called: “category-projects.php”

    this is a special “archive” or “category” page which display different archive template for special posts.

    this template works fine and using a function I created and everything looks good.

    Now, I am trying to create ACF slider using the great repeater that I have in this special category template. so I created this new group called “post_slider_projects” and a simple repeater field for images called: “post_slide_projects

    Now, I assigned the rules to appear in category and I see it when I am browsing my admin categories section.

    until this point everything is working. the only problem is that it is not displaying when I look at the site in this special category page..

    here is the code I was using to display it:

    <?php if(get_field('post_slider_projects')){ ?>
    <div class="post-section">
          <section class="flexslider">
            <ul class="slides">
              
    		  <?php	while( has_sub_field('post_slider_projects') ){ 
    			
    			$post_slide_projects = get_sub_field('post_slide_projects');
    			?>
                
    				
    
              <li class="latest-post"> <img alt="" src="<?php echo $post_slide_projects;?>"/> </li>
              <!--latest-post-->
              
              <?php } ?>
              
              
               <?php } else{ ?>
               <img alt="" src="<?php bloginfo('template_directory'); ?>/assets/images/slider-img1.jpg"/>
               <?php } ?>
    
            </ul>
          </section>
        </div>
    <?php } ?> 

    ANyting I am doing wrong here or it’s impossible to display it in that category special template?

    THanks
    GIl

Viewing 1 post (of 1 total)

The topic ‘Show ACF in special categry page’ is closed to new replies.