Home › Forums › Front-end Issues › 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
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 ?
Hi Elliot,
I’m having some trouble with the plugin, but I cant seem to create a Topic, how can I do that?
Thanks!
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
Hi @caju
You can create a new topic here:
http://support.advancedcustomfields.com/new-topic/
Thanks
E
The topic ‘Template Code doesn't work’ is closed to new replies.
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.