12 JULY 2014 - UPDATE

1) We have just released Striking 5.3 maintenance update for those still using the "Original" Striking theme. Please see the theme release thread below for details. This update is only available by the internal update function as this theme is deprecated and no longer available for sale.

2)  Next inline in a few days is Striking MultiFlex. This update is actually "in the can" but we are working on ancillary matters. Expect it sometime in the next few days.

To insert code use <code>...</code>.
Disable Automatic p tags
  • Hello,

    I am trying to disable the automatic adding of p tags....

    I tried adding : <?php remove_filter (‘the_content’, ‘wpautop’); ?>

    to my page template php files (full width, ect files)

    as described on this page: http://www.thewebsiteprofessionals.com/wordpress-paragraph-tags.html

    However that did not help....

    any idea?

  • 4 Comments sorted by
  • OK .. I have investigated this for awhile now, and it has to do with something about this theme...

    when I change to the default theme, it doesnt add 'p' tags... but this theme does.

    The reason I need to stop WP from automatically adding these tags is because I have a script I need to add in the content area, and its adding 'p' tags all over it.

    As soon as I switch to the default theme, the 'p' tags are gone and the script works.

    I even tried this plugin to disable 'p' tags, and it still didnt work in this theme : http://urbangiraffe.com/plugins/disable-wpautop/

    Any help would be great!!

  • I may be wrong here, but I believe that Kaptinlin defines his own wpautop. Also could be an issue of priority, in a theme as complicated as Striking and using add_filter and remove_filter, weird issues can occur relating to the priority - default is 10. Check out the codex for remove_filter
  • Hi,

    In 'striking/framework/functions/shortcodes/typography.php'

    You will see the code below

    * Disable Automatic Formatting on Posts
    * Thanks to TheBinaryPenguin (http://wordpress.org/support/topic/plugin-remove-wpautop-wptexturize-with-a-shortcode)
    function theme_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');

    This will cause the issue.

    If you don't want wpautop the code,
    You can edit on line 16.

    Change it to

    $new_content .= wptexturize($piece);

  • Genius!!!! the script now works!!!

This discussion has been closed.
All Discussions