-
AuthorPosts
-
November 23, 2020 at 12:09 am #1262163
Hi. I have added, with Advanced custom fields, 2 fields in the posts. Also, I would like to put the categories.
I have used this widget
And this is the result
I would like it to stay like this
I go to wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/postslider.php and above this line >> $output .= $thumbnail ? “{$thumbnail}” : “”; I put this
$taxonomies = get_object_taxonomies(get_post_type($the_id));
$output .= “<div class=’categ’>”.$taxonomies.”</div>”;But the result that you return to me is
What have I put wrong?
In the case of the country and the image of the flag, above this line >> $output .= “<h3 class=’slide-entry-title entry-title’ $markup>“.$title.”</h3>”; I have put
$pais = get_field (“País”, $entry->ID);
$output .= “<div class=’pais’>”.$pais.”</div>”;
$bandera = get_field (“bandera”, $entry->ID);
$image = get_field(‘Bandera’);
$size = ‘full’; // (thumbnail, medium, large, full or custom size)
if( $image ) {
echo wp_get_attachment_image( $image, $size );};
$output .= “<div class=’bandera’>”.$Bandera.”</div>”;And this is the result
The ARRAY is of the country and the image is not visible. How should I put it on to make it look good? The country data are from a multi-selection field and the flag data from an image field
Can you help me find the solution?
- This topic was modified 4 years ago by jeiceta.
November 23, 2020 at 6:13 am #1262255Hey jeiceta,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( to be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.Best regards,
NikkoNovember 23, 2020 at 3:37 pm #1262415This reply has been marked as private.November 23, 2020 at 3:37 pm #1262416Done. The post is in Hitos de Tenerife
- This reply was modified 4 years ago by jeiceta.
November 24, 2020 at 11:26 am #1262626Hi jeiceta,
I have checked on your site and it seems you have already done it.
The only thing I think that remains is to apply it to the child theme so your tweaks/modification won’t be lost during the theme update.
Just follow the instructions in the documentation: https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-albBest regards,
NikkoNovember 24, 2020 at 3:45 pm #1262714Hi. Thank you for reviewing it. I have added the fields that I comment on the backend, but not on the frontend. That is where I have the problem. My question is, in which file, I think it is wp-content / themes / enfold / config-templatebuilder / avia-shortcodes / postslider.php, do I have to add those fields, which I explain at the beginning of this post, and how?
November 27, 2020 at 1:56 pm #1263519Hi jeiceta,
I apologize I wasn’t able to respond before the link expired.
I was able to see those fields reflect in the frontend and the location is correct (line 764 in postslider.php):$output .= $thumbnail ? "<a href='{$link}' data-rel='slide-" . avia_post_slider::$slide . "' class='slide-image' title='{$image_link_title}'>{$thumbnail}</a>" : '';
If it’s on top of the image then place it before the code and concatenate it in the $output variable and if its below then put it after.
Best regards,
NikkoNovember 27, 2020 at 5:44 pm #1263552Hi Nikko. Right. I know that. I put it in the first entry of this post. What I would like to know is what am I doing wrong. I have put the code that you can see in the image
And the result is what you see in the following image. The Año field reflects this well. But the flags (bandera) are put where you can see, instead of under the image of the post. And put those of all the entries on the page. I do not know why. And the country (pais), instead of putting the name, in this case United Kingdom, puts ARRAY. How do I make it look the way I want?
- This reply was modified 4 years ago by jeiceta.
November 30, 2020 at 11:25 am #1263902Hi jeiceta,
I think the reason why it’s returning an array is because the Return Format of the image field is Image Array (which is set by default) and the code you used is for Image ID as written in the ACF documentation: https://www.advancedcustomfields.com/resources/image/
Best regards,
NikkoDecember 3, 2020 at 12:42 pm #1264747Hi Nikko,
Sorry for not answering earlier. I have not been able to do tests. As soon as I do, I’ll tell you. Thanks for your interest
December 3, 2020 at 4:18 pm #1264800Hi jeiceta,
No worries, just let us know if you need assistance.
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.