Advanced Custom Fields plugin probleme

deunsdenis
48 Posts
deunsdenis posted this 26 August 2015

hi,
I have a code to integrate in the file ( single.php) for display my field.

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

where be it the place for my personalized field is found between the content and the comments of an article?

see attached file

thx

hi, I have a code to integrate in the file ( single.php) for display my field. <?php the_field('titre'); ?> where be it the place for my personalized field is found between the content and the comments of an article? see attached file thx

Last edited 26 August 2015 by deunsdenis

Vote to pay developers attention to this features or issue.
10 Comments
Order By: Standard | Newest
Stagger Lee
1818 Posts
Is Solution
Stagger Lee posted this 26 August 2015

Try it this way.
How do you insert it ? It will work only with CMS Code control.

<?php
     if( function_exists('get_field')) {
         if(get_field('my_custom_field')) { 
             echo '<p>' . get_field('my_custom_field') . '</p>';
         }
     }
?>

Try it this way. How do you insert it ? It will work only with CMS Code control. <?php if( function_exists('get_field')) { if(get_field('my_custom_field')) { echo '<p>' . get_field('my_custom_field') . '</p>'; } } ?>
deunsdenis
48 Posts
deunsdenis posted this 27 August 2015

Thank you for your answer.
with theme fourteen i insert just after

`get_template_part( 'content', get_post_format() );`  



 <?php
/**
 * The Template for displaying all single posts
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */


get_header(); ?>


    <div id="primary" class="content-area">
        <div id="content" class="site-content" role="main">
            <?php
                // Start the Loop.
                while ( have_posts() ) : the_post();


                    /*
                     * Include the post format-specific template for the content. If you want to
                     * use this in a child theme, then include a file called called content-___.php
                     * (where ___ is the post format) and that will be used instead.
                     */
                    get_template_part( 'content', get_post_format() );


     if( function_exists('get_field')) {
         if(get_field('titre')) { 
             echo '<p>' . get_field('titre') . '</p>';
         }
     }

Is good my display field is good (see below)

is good for fourteen theme

But i don't know insert this code for theme themler . i don't find get_template_part( 'content', get_post_format() ); for insert my code.

My field is not found the right place ( see below)

not good with themler

thx for help
deuns26

ps: if we could THEMLER in php in html code to echo.(his would be the dream)

Thank you for your answer. with theme fourteen i insert just after `get_template_part( 'content', get_post_format() );` <?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); if( function_exists('get_field')) { if(get_field('titre')) { echo '<p>' . get_field('titre') . '</p>'; } } Is good my display field is good (see below)![is good for fourteen theme][1] But i don't know insert this code for theme themler . i don't find `get_template_part( 'content', get_post_format() );` for insert my code. My field is not found the right place ( see below) ![not good with themler][2] [1]: http://s22.postimg.org/bc2p9gsi9/theme_fourteen.jpg [2]: http://s23.postimg.org/vd62mao7f/theme_themler.jpg thx for help deuns26 ps: if we could THEMLER in php in html code to echo.(his would be the dream)

Last edited 27 August 2015 by deunsdenis

Stagger Lee
1818 Posts
Stagger Lee posted this 27 August 2015

You are confuse and need to read old topics here at forum and documentation.

You dont touch PHP files. Go to the Insert tab and find CMS Code control. Drag and drop it wehere you want, and paste this ACF code inside.

You are confuse and need to read old topics here at forum and documentation. You dont touch PHP files. Go to the Insert tab and find CMS Code control. Drag and drop it wehere you want, and paste this ACF code inside.
deunsdenis
48 Posts
deunsdenis posted this 27 August 2015

Hi
I understand thx

I did not know it was possible to do this

It's good

thank you for taking the time to answer me
I wish you a good day

I vote STAGGER LEE :-)

Hi I understand thx I did not know it was possible to do this It's good thank you for taking the time to answer me I wish you a good day I vote STAGGER LEE :-)
Stagger Lee
1818 Posts
Stagger Lee posted this 27 August 2015

You are welcome.

Take it easy to avoid frustration. Give Themler few weeks, it is much more complex and difficult than Artisteer.

You are welcome. Take it easy to avoid frustration. Give Themler few weeks, it is much more complex and difficult than Artisteer.
deunsdenis
48 Posts
deunsdenis posted this 27 August 2015

yes themler is difficult vs artisteer but is very good.

PS:

simply

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

work too

thx and good bb

yes themler is difficult vs artisteer but is very good. PS: simply <?php the_field('my_custom_field'); ?> work too thx and good bb

Last edited 27 August 2015 by deunsdenis

Stagger Lee
1818 Posts
Stagger Lee posted this 27 August 2015

Use above code and WP will not spit you errors, and probably blank page, if new WP version stop to work with your version of ACF.

Use above code and WP will not spit you errors, and probably blank page, if new WP version stop to work with your version of ACF.
deunsdenis
48 Posts
deunsdenis posted this 28 August 2015

Yes you are right , I begin the code , so not easy at the beginning.
I try to convert your code to work with my other fields.
example: I tested for image fields,can be , not fair, but his works.

<?php
     if( function_exists('get_field')) {
         if(get_field('image')) { 
           echo '<p><img src="'.get_field('image').'"/></p>';
         }
     }
?>

ACF other fields are more complicated, but I will succeed

Yes you are right , I begin the code , so not easy at the beginning. I try to convert your code to work with my other fields. example: I tested for image fields,can be , not fair, but his works. <?php if( function_exists('get_field')) { if(get_field('image')) { echo '<p><img src="'.get_field('image').'"/></p>'; } } ?> ACF other fields are more complicated, but I will succeed

Last edited 28 August 2015 by deunsdenis

fannindion
2 Posts
fannindion posted this 25 April 2025

A lot of websites put a personalized input field right between the article's main content and the comments part. This could be a registration form, a feedback box, or a field for users to leave comments slope 2. This lets people interact with the material before or after reading the comments of others.

A lot of websites put a personalized input field right between the article's main content and the comments part. This could be a registration form, a feedback box, or a field for users to leave comments [slope 2][1]. This lets people interact with the material before or after reading the comments of others. [1]: https://slope-2.io/
rosiewilsonnsjh
2 Posts
rosiewilsonnsjh posted this 2 days ago

Go to the Joomla! Admin page and click on Content > Fields . To make a new unique field, click on "New." Fill in the information asked for in your area, such as the title, type, brainrot clicker Make sure you put it in the right place, like "Articles."

Go to the Joomla! Admin page and click on Content > Fields . To make a new unique field, click on "New." Fill in the information asked for in your area, such as the title, type, [brainrot clicker](https://brainrotclicker.io/) Make sure you put it in the right place, like "Articles."
You must log in or register to leave comments