field wysiwyg acf missing p in post content (wordpress with twig) - php

I created a Wysiwyg field with ACF, when I fill this field in my page with texts having paragraphs, these are removed and replaced by " " when I display them, can someone help me above ?
This is how I display :
<div class="content-description">
{{ post.custom.content }}
</div>`

I added wpautop and everything is good now
<div class="content-description">
{{ post.custom.content|wpautop }}
</div>

Related

WordPress forces a line break after each shortcode. How to fix?

I just can't figure this out. Wordpress seems to be adding a br tag at the end of each shortcode. What I'm trying to do is the following:
This deal is posted on [shortcode] and is available via [shortcode]
What Wordpress actually does:
This deal is posted on [shortcode]
and is available via [shortcode]
It's a shortcode I made with a custom field. I fill in a certain form and the shortcode spits whatever I filled in in that form.
If you check this link, the text which displays "Aanbieding geldig bij: Amazon.nl" 3 times, should display on one line. "Amazon.nl" is displayed by the shortcode.
What do I do to have it not put a line break after a shortcode?
It's in your style rh-flex-center-align
change it to
.rh-flex-center-align{
display:inline-flex;
}
Or, if you can't do that, inject the style inline on the element generated through the shortcode
<div class="rh-flex-center-align" style="display: inline-flex;">
<span class="meta_v_label mr5 rtlml5">Aanbieding geldig bij: </span> Amazon.nl
</div>

Translate text in wordpress

I'm using WPML plugin to make my website multilingual and some of the text / button text can't be translate.
I have this code:
<div class="header-left">
<div class="num">
<strong> Call us Now </strong>
+000000
</div>
</div>
I have this block of code in wordpress php file.
How to add this as a string so i can translate it with WPML?
You have to put the text in a function like this :
<?php echo __('Call us Now', 'yourtextdomain'; ?>
or you can just do
<?php _e('Call us Now', 'yourtextdomain'; ?>
Then go to WPML and resync your theme or plugin where you have this text. (There is also an option to do that automatically)
Check the doc to know more :
https://developer.wordpress.org/reference/functions/__/

Custom field now showing up on my new page using Wordpress?

I created a new template for a page.
<?php
/**
* Template Name: Sponsors For Homepage
*/
?>
<html>
<body>
<?php get_header('sponsor'); ?>
<div class='divone'>
<?php the_content(); ?>
</div>
<div class='divtwo'>
<?php sponser_advertisement(); ?>
</div>
</section>
</body>
</html>
And I added a new custom field for the template. Using the Advanced Custom Fields plugin 4.4.8
I made sure that the field would show on the correct template:
The fields showed up on my template page
For some reason the field value "This is the new field" does not not show up when I preview the page in my browser.
Thanks in advance.
Suggestions?
This is the wrong way to display the custom field value.
If you want to display custom field values in your template, using Advanced custom fields plugin you have to use functions like these:
<?php the_field('field_name'); ?>
or
<?php echo get_field('field_name'); ?>
you can find full documentation on working with ACF values in here:
ACF Documentation

phpbb3 How do I get Custom Profile Fields to showup on posts made by users?

I have this code: But it dosn't work.
from viewtopic_body.html
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "ingame_name" -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- END custom_fields -->
My custom field name is called "ingame_username" and is set to display everywhere possible in the options, ive deleted the cache after making changes and still doesn't show.
How do I display is with the code structure above and how can I call it in other parts of the template?
Theres very limited documentation about this.
I agree it is not very straight forward, since there are a few options you need to check under ACP, and you also have to edit your template. Here are the steps:
Go to "ACP > Users and Groups (tab) > Custom Profile Fields (link) > Click on the settings icon" rename your custom field from "ingame_username" to "ingameusername", since the under score will cause issues.
On that same page make sure that the "Display on viewtopic screen" option is checked for the field in question.
Go to "ACP > General (tab) > Server Configuration (section) > Load Settings (link)", and make sure that the "Display custom Profile fields on topic pages" radio option is checked.
Find the line in "viewtopic_body.html" that contains:
{postrow.POSTER_FROM}
Underneath it, add the following line (line 184 in phpbb 3.0.10):
<!-- IF postrow.custom_fields.PROFILE_INGAMEUSERNAME_NAME --><dd><strong>{postrow.custom_fields.PROFILE_INGAMEUSERNAME_NAME}:</strong> {postrow.custom_fields.PROFILE_INGAMEUSERNAME_VALUE}</dd><!-- ENDIF -->
That's it! You will now see the custom field and it's value on the Viewtopic Page.
Pete

Removing posted by and date from posts on wordpress

How do I remove the date added/admin/no comments section of each one of my posts in my wordpress blog here http://www.kvylfm.com
Edit your template file index.php and look for this snippet:
<div class="post-info clear-block with-thumbs">
when you found it, it would be something like this:
<div class="post-info clear-block with-thumbs">
<p class="author alignleft">Posted by .........</p>
<p class="comments alignright">.........</p>
</div>
Just remove it all.
If you don't know what template it is, on admin panel, look at Appearance ยป Editor.
You should see list of files on right side of that page. Just find 'Main Index Template' and edit it, look at snippet above then remove it.

Categories