Custom Field add markup to line breaks

I believe this is what you are after: // define $post_id, $key, $single $multipleLineValue = get_post_meta($post_id, $key, $single); // Convert into an array where desired code can be added to the output $multipleLineValue = explode(“\n”,$multipleLineValue); $output = “”; foreach ($multipleLineValue as $lineValue) { $output .= “<span>”.$lineValue.”</span><br>”; } echo $output;

How do I format my custom html so wpautop won’t try to reformat it?

The function that does what I think you are referring to is wpautop(), probably the most complained about function is all of WordPress-dom. It is a filter on the the_content hook among others. You can remove that with: remove_filter(‘the_content’,’wpautop’); I would suggest that you spend some time looking through the many related questions to see … Read more

ACF Shortcode bringing in my shortcode is adding unnecessary line breaks

It was solved by a coworker. function removebreaks($content) { $content = str_replace(‘<br>’, ”, $content); $content = str_replace(‘<br/>’, ”, $content); $content = str_replace(‘<br />’, ”, $content); $content = str_replace(‘<BR>’, ”, $content); $content = str_replace(‘<BR/>’, ”, $content); $content = str_replace(‘<BR />’, ”, $content); return $content; } add_filter(‘acf_the_content’, ‘removebreaks’);

Keep br tags from stripping

Since any attribute added to <br> tag, including class names and data-attrs keeps them from stripping, quick and incomplete way could be: function filter_function_name( $content, $post_id ) { $content = str_replace(‘<br>’, ‘<br data-x>’, $content); $content = str_replace(‘<br >’, ‘<br data-x>’, $content); $content = str_replace(‘<br />’, ‘<br data-x>’, $content); $content = str_replace(‘<br/>’, ‘<br data-x>’, $content); return … Read more

wpautop filter off for pages but on for posts

You could try this in your functions.php file function disable_wpautop_for_pages(){ if ( is_page()){ remove_filter( ‘the_content’, ‘wpautop’ ); } } add_action(‘init’, ‘disable_wpautop_for_pages’); I have not tried this. It’s just a guess

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)