Support

Account

Forum Replies Created

  • Okay I figured it out. I trimmed off the subcategories, but my problem was that I was not associating category with the field and value. So the $cat was acting as the post id in the same way that a page will render an ACF value.

    <?php
    
    	$taxonomy     = 'product_cat';
    	$orderby      = 'name';
    	$show_count   = 0;      // 1 for yes, 0 for no
    	$pad_counts   = 0;      // 1 for yes, 0 for no
    	$hierarchical = 1;      // 1 for yes, 0 for no
    	$title        = '';
    	$empty        = 0;
    	$post_id 			= 1;
    	$args = array(
    				 'taxonomy'     => $taxonomy,
    				 'orderby'      => $orderby,
    				 'show_count'   => $show_count,
    				 'pad_counts'   => $pad_counts,
    				 'hierarchical' => $hierarchical,
    				 'title_li'     => $title,
    				 'hide_empty'   => $empty,
    	);
     $all_categories = get_categories( $args );
     foreach ($all_categories as $cat) {
    		if($cat->category_parent == 0) {
    				$category_id = $cat->term_id;
    				$icon = get_field('category_icon', $cat);
    
    				echo '<div class="cat-box"><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name;
    			  echo '<div class="clear"></div>'. $icon;
    				echo '</a></div>';
    		}
    }
    ?>
    
  • Tried that below the have_rows(second_buttons) repeater

    And still not rendering the values. I think its a conflict with the IDXpress, like you said. I did start a support ticket with them. So once they respond I’ll post what the issue is here. Thanks John for your time and help

    – Alex

  • Yeah I tried to deactivate all the plugins and the problem is still there. The repeater option works on all other pages except for the IDX pages. On the home page…I have a quick search of listings and featured listings that is pulling data from the MLS…but its a custom template that I made…home_page.php.

    I know you are right….that the individual IDX posts and archive posts are somehow incompatible with ACF. Hmmm….what to do.

  • Yeah thats it. I did have a “Cannot modify header information – headers already sent by (output started at /some/file.php:11) in /some/file.php on line 483 earlier…

  • Yes. Just added “Text”. See below.

    <?php if (have_rows('second_buttons','option')):
      while (have_rows('second_buttons','option')): the_row(); ?>
      <div class="button-icons">
    <a href="<?php the_sub_field('button_link','option'); ?>"><div class="icon-circle"><?php the_sub_field('button_icon','option'); ?></div>
      <div class="2ndnav_text">
      <span><?php the_sub_field('intro_title','option'); ?></span>
    <h4><?php the_sub_field('button_title','option');?></h4>
    </div>
    </a>
    </div>
    <?php endwhile;
    endif; ?>
    TEXT

    That rendered where the second nav should be just fine…and this is on the listing page. It seems that the page isn’t reading the option repeater….but on every other post, page it does. I don’t get it.

  • Its not though, because the rest of the normal header HTML is populating. Its just the secondary nav fields that isn’t, which are the custom fields. It seems that the listings template just isnt reading the values of the fields.

  • Hey guys, shortcodes only work if you create the shortcode in functions.php. Use the the_field php execution. <?php the_field('field_name'); ?>

  • Hi Lt_Core, ok so you can place the custom fields on both pages and posts. So lets say you create a page “Portfolio”. Go into Custom Fields and create a new field. You can set a rule for your field that says it will show up on “Page” and your pages will show up in a drop down menu. Then choose Portfolio and your custom field will be on your “Portfolio” content editor page. As for the code. If you create a text field, then it depends on what you call it….but lets just say you call it Top Content. then the value will be top_content. Go to your Portfolio page and fill out your top_content field with your content. Then you need to go into the page template that you want the content to show up on and add the following code:

    <?php the_field('top_content'); ?>

  • You have to add it to content.php. The reason you add it here to add it to all your blog posts, is that it follows a hierarchy of templates to call the content.php into every blog post. It goes Main Index Template(index.php) > content.php. Meaning content.php is part of the Main Index Template.

    So if you want to add your field right under the title, go to content.php, and add your php snippet under a div tag classed “entry-content”. Just add it under that opening tag. 🙂

  • Well, it functions as an easy client-based custom-field software, where its easy to update a page(as a non-developer), once the fields are in place. I see what you mean though. If you want me to help you, email me at info@toolboxwebdesign.

  • Well the whole point of ACF is to be able to add fields to the Page/Post Editor dashboard, so you don’t have to add to the content editor and your field will populate onto the page. So to answer your question, no…the snippets need to be added to the template.

  • No, are you familiar with WordPress templates? So, on the WordPress dashboard, go to your homepage editor. Pages > Home.

    On the right panel, where you can publish your page, you should see ‘Page Attributes’. That will tell you which template you are using for your homepage. Then go to Appearance > Editor > look for the template file that your page attribute for your homepage is using.

    This will show the code markup for your homepage template and you can place the <?php the_field('home_text'); ?> wherever in the code you want your field to render on the homepage.

  • So lets say you have a pretty generic Homepage Template

    <?php
    /**
     *Template Name: Home
     */
    <?php get_header(); ?>
    <?php the_field('home_text'); ?>
    <?php get_footer(); ?>
    ?>

    If you place “the_field” php execution like above, your custom field will show within this template.

  • Ok, so you create the fields in the “Custom Fields” tab in the WordPress dashboard. If you have done this and created a field, it will yield a “value”. So if you create a field called “Home Text”, the value field will be home_text.

    When you create a rule for the “Home Text” to be shown on your “Home” page, then the fillable field will show on the Home Page dashboard.

    Once that is done, you need to call the field value within the template that is being used for the Home Page. Are you using a Home Page template or the default template?

Viewing 16 posts - 1 through 16 (of 16 total)