[Resolved] Still the custom page template

Home Forums Support Still the custom page template

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #1279872

    Hi there,

    I’m trying to develop a page using a custom page template that I had support here:

    But something happens (maybe related to the style sheet) and it looks different than I expected.

    What I want is this: https://www.zenite.nu/vida

    But what I got (with my custom page template) is: https://www.zenite.nu/a-trilha-da-vida/

    I can’t understand because when I view the source code of both pages they look the same, except by the tags (in the second one)

    <article id="post-ID ...
    <div class="inside-article">
    <div class="entry-content" itemprop="text">

    that include the entire document, but it doesn’t seem to be the cause of this problem.

    Moreover, in that page, the first tag ( <main> ) is nested inside paragraph tags <P> that I don’t know where it came from!

    Could you give me some help on what may be going on?


    I figure out!

    The problem was the automatic paragraph tags (from WP itself).
    I used a filter:
    remove_filter ('the_content', 'wpautop');
    and now it´s all right!

    Customer Support

    Glad to hear that – looks great !


    Thank you, David!!

    Do you know why WP does this on some pages, but – apparently – not on others?

    Are there any implications in applying this filter to the entire site?

    Lead Developer
    Lead Developer

    Hi there,

    That filter is applied to everything that runs through the_content() filter. It adds paragraph tags automatically to your text so you don’t have to.

    There could definitely be some bad things that happen if you remove it site-wide, but I don’t even think it’s used on pages using the block editor anymore, which is good.

    You can always target a page template:

    add_action( 'wp', function() {
        if ( is_page_template( 'your-page-template.php' ) ) {
            remove_filter( 'the_content', 'wpautop' );
    } );

    Thank you –
    As always, you guys help a lot!

    Lead Developer
    Lead Developer
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.