ACF visual wysiwyg field not displaying formatting - wordpress

My ACF WYSIWYG field is not displaying formatting on the front end once a post is published.
Screenshot of how it looks in wp admin:
But once this goes live it just goes into a mush of text without spacing. Strong tags seem to stay..
Using this to display the WYSIWYG acf field:
<?php (the_field('description')); ?>

Try
the_field('description', false, false);
The third parameter is for format value. You may also check the documentation: https://www.advancedcustomfields.com/resources/the_field/

Solved.
It was a tinyMCE setting. For others tick this:
The job descriptions are now formatted at https://workfromhomejobs.me/remote-developer-jobs/

Related

What is the php I need to show a Custom Field Value from a Drop Down Box, Type (Select2), in Wordpress

Currently I am using this php code to display Text for a custom field with taxonomy 'years' in a theme in wordpress, that works well
php echo get_post_meta($post->ID, 'years', true); (Including the php opening and closing tags)
But the problem I have is that if I want to change this Text, to a Drop Down Box (a select2 type), to let choose different options to the users, I cannot find how to display the values correctly.
Any body has any idea of how to display correctly the value of a custom field froma Drop Down selec2 type ?
Thanks for any help on this
Here's how I would accomplish this.
On your post or page, add the custom field. So if you have a custom field of 'years' we'll add 2013 and 2014 and 2015 as 3 entries. Save your post/page.
This creates an array for this custom field that you can iterate through. see here for code. http://pastebin.com/Ungm3WZW
FYI - I referenced the codex for http://codex.wordpress.org/Function_Reference/get_post_custom_values

Wordpress: How to pass additional Content to the blog-preview page?

For each blog-post on my wordpress-blog I'd like to have Teaxtarea where i can pass additional content for that post.
In my case that would be an unordered list which contains a quick overview of the content.
That additional content should be displayed in the preview of the post on the blog-preview-page.
My problem:
I am actually not sure on how to best add this additional content and then pass it to the preview.
Do I use wordpress' custom fields for something like this?
I'm gratefull for a push in the right direction.
Thank you,
Nils
If I understand you right, I'd take a look at "custom meta boxes" functionality - it allows you to add any type of additional input into your blog post admin area, and than display its content on front-end however you like.
There's a nice tutorial series on that topic, with example code snippets:
http://wp.tutsplus.com/series/reusable-custom-meta-boxes/
And if you'd like to display the textarea content only in preview mode, you can use appropriate conditional tag in you template file:
http://codex.wordpress.org/Conditional_Tags#A_Preview
The conditional tag is_preview returns true when a single post is viewed in Draft mode. The following will append post meta to the content when a post is being previewed:
function so16799607_preview( $content )
{
if ( ! is_preview() )
return $content;
return $content . get_post_meta( get_the_ID(), 'my_post_meta', true );
}
add_filter( 'the_content', 'so16799607_preview', 10, 1 );
You should check out Advanced Custom Fields. That's a really stable plugin that lets you create custom meta boxes in posts, pages and custom post types. That plugin does exactly what your question states. Need al little PHP to get stuff from your database, but that is as easy as:
<?php the_field(field_name);?>
And the documentation is pretty good. And if you don't like a plugin, it exports the PHP as well.
Anther tool that does the same is Pods Framework. Both powerfull extensions to any WP install in my opinion.
Hope this helps.

wordpress shortcodes show up in preview posts

http://www.mytwins.gr/site/
In the third blog post you will see that a shortcode shows up [frame align="none"]Της Εύης Σταθάτου[/frame] which is ugly. Only if you click it, it works fine.
Why is that?, How can you hide the code from the previews posts thingy? Thanks in advance.
P.S I tried to hide the shortcode from the visual mode and enter it in the text mode, but still the same.
As #Ravi suggests, make sure that your plugins are enabled. However, it looks like your shortcodes are appearing within your excerpts (assuming you're using the_excerpt() for the snippets appearing on your homepage?)
I would suggest a handy snippet of RegEx:
$myExcerpt = get_the_excerpt();
$myExcerpt = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $myExcerpt);
echo $myExcerpt;
That should stop the raw shortcodes from appearing.

Adding A Button Between post-content and Related Posts Thumbnail Plugin on WordPress

I am trying to add a button to my WordPress template. Basically, I have the post and then there is the Related Posts Thumbnails widget that appears. I want the button to go between the text of the post and the related posts thumbnail widget. The code in my 'Single Post' that contains all of this is as follows:
<div class="post-content">
<?php the_content(__('<em><strong>More:</strong> Read the rest of this entry...</em>', 'life-is-simple')); ?>
</div>
I know the Related Posts Thumbnails plugin falls within this code because it's at that place when I 'Inspect Element' on Google Chrome. I can't find how to edit the order of things within that div though. Any help would be greatly appreciated, thanks!
EDIT
Clarification: I am using the Life Is Simple WordPress theme although it has been custom editing quite a bit (mostly on the CSS side of things though).
That plugin is probably appending the output to the_content with a filter .
That means , that the output is being added to the_content automatically. it is a common behaviour.
You need to look at the plugin´s admin interface to see if you can have an alternative way (I believe there is ) which is using a template tag. in that case, you should put the template tag after the div where the the_content() is .
EDIT I :
After a small dig, - in fact there is - you need to put
<?php get_related_posts_thumbnails(); ?>
Then the plugin should know by itself not to append to the_content.
For parameter passing, or if something is not working, go read their APi or help files.
You'll probably need to edit single.php or archive.php in your theme. If nothing is occuring there that looks familiar, it's probably using a loop. In which case you might find what you are looking for either in loop.php, loop-single.php, or loop-archive.php depending on what type of page you are on and how the theme was constructed. Add your button near where you find Read the rest of this entry...
With more information (such as what theme you are using), one might be able to help more as well.

WordPress - displaying posts in a page

I would like to display the posts the way they are shown when you have "show latest post" selected under reading settings.
I've tried using query_posts, but that displays the whole post, not the chunk that appears in the preview with the link at the bottom.
any ideas what I should be querying to get that?
Edit
I forgot to mention
I tried using the_excerpt(), but that doesn't show the image in the post. Also the index.php file is using the the_content() and it's displaying it the way I want it to
If you don't want to show the whole post, you should use the_excerpt() instead of the_post()
Edit:
From codex:
<?php the_content('Read more...'); ?> Displays the content of the post and uses "Read more..." for the more link text when the Quicktag is used.
Basically, use the_content('your text for the link') and add the quicktag to your article, this will automatically just show the text before

Resources