Tagged: acf
-
AuthorPosts
-
October 12, 2019 at 3:49 am #1147294
Hello!
I have inserted an custom field in single-q_a.php for my custom post type q_a://show custom field the_field('svar_til_brukeren'); //show related posts based on tags if there are any get_template_part( 'includes/related-posts');
Now the social share section is displayed above this field, I would like them to be below the custom field.
October 13, 2019 at 10:28 am #1147540Hey guttogjente,
Your code runs after /enfold/includes/loop-index.php and it should run inside. The share buttons function is called before the code that you added.
Best regards,
VictoriaOctober 14, 2019 at 5:04 am #1147700Thanks, Victoria!
I copied loop-index.php and added my code after line 346 like this :echo $close_header; ?> <h5>Gutt og Jente svarer:</h5> <?php //show custom field the_field('svar_til_brukeren'); // echo the post content
Then I renamed it loop-index-q_a.php (since this is only for that custom post type) and added it to the includes folder in my child theme, but could not see any change on my page, so I therefore removed it again so it should not cause any error. Should I also modify something simple-q_a.php in order for to be called instead of loop-index.php for this post type, like line 40:
get_template_part( 'includes/loop', 'index' );
October 16, 2019 at 4:59 pm #1148498Hi guttogjente,
Yes, you need to call your custom file it the get_template_part.
Best regards,
VictoriaOctober 17, 2019 at 6:37 am #1148795Thanks, Victoria! I added loop-index-q_a.php as described above, read about the syntax for the get_template_part() function and changed the loop-index call in simple-q_a.php to:
get_template_part( 'includes/loop', 'index', 'q_a' );
But it still does not work after I cleared cache. Do you know why? If you have time, you can log in through the information I shared in the private content in the first post.October 22, 2019 at 10:14 am #1150098 -
AuthorPosts
- You must be logged in to reply to this topic.