Support

Account

Home Forums Front-end Issues Template Code doesn't work

Solving

Template Code doesn't work

  • Hi, I face some problem. One of my wordpress theme doesn’t work Template Code.
    I want to add ACF template code after H2 tag.
    Here is my ACF template code
    <?php the_field('subtitle'); ?>

    & This is my WordPress theme code:

      $data = $data . '<article class="blog-thumb style_1 clearfix"><h2 class=" blogtitle"><a class="title" href="'.$permalink.'">';
      
      if(is_sticky()){
      	$data = $data . '<span class="sticky icon-paper-clip"> </span> ';
      }
      $data = $data . $the_title.'</a></h2>';
     
      $data = $data . '<ul class="meta-entry clearfix"><li><p><span class="icon-user"> </span> '.$the_author_posts_link.'</p></li><li><p><span class="icon-tag"> </span> '.$cat_echo_p.'</p></li><li><p><span class="icon-calendar"> </span> '.get_the_time('F') .' '. get_the_time('j') .', '. get_the_time('Y').'</p></li>';

    Please plugin author or Someone give me the solution.
    Thanks

    • Elliot

    • January 31, 2014 at 12:06 pm

    Hi @mrhossen

    Your ‘theme code’ shows no use of any ACF functions such as get_field or the_field. This is why no value is being displayed.

    Thanks
    E

  • Thanks @elliot for reply.
    There no way to add the ACF function ? Is it possible to add ACF function through shortcode on my theme template ?

    • caju

    • February 1, 2014 at 2:11 am

    Hi Elliot,

    I’m having some trouble with the plugin, but I cant seem to create a Topic, how can I do that?

    Thanks!

    • Elliot

    • February 2, 2014 at 12:53 pm

    Hi @mrhossen

    Yes, there is a shortcode for outputing text based values. You car read about it here:
    http://www.advancedcustomfields.com/resources/functions/shortcode/

    Normally, you would edit your template files to output any ACF values.
    http://www.advancedcustomfields.com/resources/getting-started/displaying-custom-field-values-in-your-theme/

    Thanks
    E

    • Elliot

    • February 2, 2014 at 12:53 pm

    Hi @caju

    You can create a new topic here:
    http://support.advancedcustomfields.com/new-topic/

    Thanks
    E

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.