Docs    Facebook    Troubleshooting

The formatting of my Facebook feed is incorrect or messed up

There could be a number of causes for this:

1) The plugin’s CSS file is not being loaded into your page.

You can check this by right clicking on your web page and choosing ‘View Source’. You can then check to see whether the CSS file is being loaded into the header of your page. It should look like this:

<link rel=’stylesheet’ id=’cff-css’ href=’http://yourwebsite.com/wp-content/plugins/custom-facebook-feed-pro/css/cff-style.css’ type=’text/css’ media=’all’ />

If it isn’t there then it’s most likely that your theme doesn’t have the WordPress wp_head() function in it’s header.php file. This function is required by plugins in order to include plugin CSS files in your page. To add this function to your theme simply open your theme’s header.php file and add the following before the closing </head> tag:

<?php wp_head(); ?>

2) Your theme or another plugin contains CSS which is being applied to the Facebook feed.

The plugin is designed to inherit the CSS from your theme and occasionally some particular CSS from your theme’s stylesheet may cause some minor issues with the formatting. If you’re unable to find the cause of the problem then please contact support for assistance.

3) Some theme’s use their own content formatting function which overrides the WordPress default function and can cause some issues with plugin formatting.

Try wrapping the [custom-facebook-feed] shortcode in a [raw] shortcode, as demonstrated below:

[raw][custom-facebook-feed][/raw]

If that doesn’t solve the problem then try adding the following to your theme’s functions.php file and wrapping the shortcode in [raw] tags once again:


function cff_formatter($content) {
$new_content = '';
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);

foreach ($pieces as $piece) {
if (preg_match($pattern_contents, $piece, $matches)) {
$new_content .= $matches[1];
} else {
$new_content .= wptexturize(wpautop($piece));
}
}
return $new_content;
}
remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
add_filter('widget_text', 'do_shortcode');
add_filter('widget_text', 'cff_formatter', 99);
add_filter('the_content', 'cff_formatter', 99);

If that doesn’t solve the problem, then try adding the following JavaScript to your site. This can be done manually using a custom JavaScript plugin. For further information see our documentation here.

$('#cff p').each(function(){ 
  if($(this).html().length < 2) $(this).remove();
});
support

Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?