WordPress' ACF plugin: break at instructions field - wordpress

When you create a field in the ACF (Advanced Custom Fields) plugin in WordPress, you can add an instruction to the field. Is there a way to add an break to it?

Yes - the ACF Instructions setting accepts some basic HTML.
A line break can be added using <br />.

Well put #Tim Malone. I'm sharing an example for a description in one of my custom fields.
Wrap a word in a span tag to highlight:<br/><br/>
<code><span><span style="background-color: #ffffcc;">highlight</span></span></code>
<br/><br/>

Related

ACF visual wysiwyg field not displaying formatting

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/

Wordpress automatically adding paragraph

So I am working on making a child theme of the "twenty fifteen" theme.
So far I have made custom post types with custom fields. It is imperative that I use custom fields for adding Soundcloud embedds. I have used the "Advanced Custom Fieds" plugin to do so.
Now, the problem I have is that whenever I use the custom field to add a soundcloud widget (just by pasting the link) it seems that the WYSIWYG Editor is adding the link inside a paragraph like this
<p>https://soundcloud.com/skitofficial/skit-ghost-dog</p>
This causes (I think) a white line (a new paragraph) to appear below the Soundcloud widget.
As you can see in the picture below, if I open the code view of the WYSIWYG I can spot the paragraph lines being added around the link.
So all in all, the main problem for me here is the white space below the soundcloud widget. Perhaps it does not have to do anything with the paragraph tag, but either way I the space below the widget looks bad, unprofessional and I need to remove it somehow. Now you may say "why don't you just remove those paragraph tags?" and that is the problem, even if I remove them, they are added automatically.
So, any suggestions would be very appreciated. I have worked my head on this for three days without any progress.
Edit: this question is old and I do not have the site anymore.
I would just add this style to a global stylesheet:
.SoundcloudEmbedd p { margin: 0; }
seems safe
Wordpress WYSIWYG pops in <p> tags. If you're not careful, it will <p> all over your content.
https://codex.wordpress.org/Function_Reference/wpautop
Pop this into your functions.php
remove_filter( 'the_content', 'wpautop' );
EDIT
If you're using ACF, the text area field type has an option for whether or not to add the <p> tags. As mevius suggests, depending on your use case, you may want to consider using the URL field type.
OR, you can use this when calling the field in your theme.
the_field('wysiwyg_field', false, false);
It's possible that the WYSIWYG is adding those <p> tags, due to WordPress's wpautop function.
Rather than completely disabling wpautop, you could remove the <p> tags using a combination of get_field() and wp_strip_all_tags():
echo wp_strip_all_tags( get_field('field_name'), true );
EDIT: On second thought, why are you using a WYSIWYG for this at all? If you're just pasting a link, you should consider using a text field, or a url field.
I did not have access to the code, nor I had access to any plugins, hence I tried this only using the WYSIWYG editor.
To remove the any unwanted paragraphs from any particular web element like div just follow these steps:
add a class to your div (the div which is containing that unwanted paragraphs).
Write a javascript function using querySelectorAll.
Example Below:
var blankps=document.querySelectorAll('.removePara p');for(var i=0;i<blankps.length;i++){blankps[i].remove();}
<div class="col-xs-12 col-md-3 removePara">
<p></p>
How to Remove Empty Paragraphs. Solved.
<p></p>
</div>
Note: This will remove all the paragraphs inside any div which has class="removePara".
Hope this helps someone.

Wordpress Shortcode syntax

I am using the Avada theme on my WordPress which makes use of Countdown Boxes, constructing pages using the provided Fusion Page Builder. The countdown box will show the number of days to a certain date which is output through a plugin called Days-Until. Syntax for implementing this: [days_until date="15 April 2015"].
I am trying to use this Days-until shortcode and pass the value to the countdown box shortcode using the Fusion (WYSIWYG Editor):
[counters_box columns="4" color="" title_size="" icon_size="" body_color=""
body_size="" border_color="" class="" id=""][counter_box value="[days_until
date="4 April 2015"]" unit="" unit_pos="suffix" icon="" direction="up"]"
unit="" unit_pos="suffix" icon="" direction="up"]Text[/counter_box]
Unfortunately the code doesn't work, and the following is displayed.
0 (in the counter box)
unit=”” unit_pos=”suffix” icon=”” direction=”up”]” unit=”” unit_pos=”suffix” icon=”” direction=”up”]Text
Is it even possible to do what I'm trying to do?
Thanks
It's not possible to nest one shortcode inside another (i.e. your days_until shortcode inside the counter_box) without some programming.
It's a commercial theme so we're unable to see the original PHP code.
What'd you need to do is edit the code for counter_box so it calls do_shortcode on the value parameter.
do_shortcode is a function that expands any shortcodes in the supplied text (in the same way they are if they've been pasted into the content field of a Page or Post), so the days_until code will be converted to a number that the counter can use.
I would suggest getting in touch with the theme developer.
Further reading: WordPress Shortcode API

Wordpress - Remove auto tags from field content in custom posts type

NOTE: Previous questions on this subject only relate to content entered into the main Wordpress editor window - NOT custom fields in the admin area. The accepted answers do not answer this question.
This question is specific to removing surplus <p> and <br /> tags within custom fields.
Using Wordpress I know it's pretty simple to remove the <br/> and <p> tags from the content entered in the editor:
remove_filter('the_content', 'wpautop');
However, while this deals with content entered in the main post info window, this isn't being applied to markup entered in a 'Types' custom field in a custom post type. There, when content is pasted in, it still gets the auto <p> and <br /> tags.
I can work around this temporarily by altering the core includes/formatting.php file:
function wpautop($pee, $br = 0) {
However, this will get overwritten on future Wordpress upgrades. How can I remove auto <p> and <br/> tags from any content entered in the Wordpress admin area - specifically custom field areas where the remove_filter on the_content has no effect?

How to add a meta keyword tag in each page of my drupal application?

I want to add a meta keyword tag which have to come with every pages within my drupal website. How to do that ?
It's too easy just use the meta tag module .
And for drupal6 i found this: Meta tags Node Type
Welcome
It might need a bit of tweaking but I built a module that does this.
https://github.com/SpaceBeers/Drupal-7-Meta-Tags-Module
It also lets you set a site wide default title and description which can be overridden for each node. You can select which content types this appears on.
It'd be nice to get some feed back on it.
Just add The code given below at the top of your template.php file (Custom).
drupal_set_html_head('<meta name="keywords" content="CustomKeyword" />');
Done.

Resources