WordPress.org

Ready to get started?Download WordPress

Forums

Using the WordPress visual editor with Pages built from a custom page template (7 posts)

  1. mrmbsanchez
    Member
    Posted 1 year ago #

    I can use the WP Visual Editor with pages I have created by adding new pages in WP dasboard. However, I can't do this with the same Pages built when I change from the template drop down menu of default to a custom page template that I have created. The page itself works fine and I can see the original text/content that I added to the page when I created it and used the default template. However, I created a custom page template and am using that instead of the default. Is there something I need to enable? I want my users to be able to use the WP visual editor to make changes.

  2. s_ha_dum
    Member
    Posted 1 year ago #

    Does your custom page template have a Loop in it?

  3. Buzz-Team
    Member
    Posted 1 year ago #

    I just installed the Custom Page Plugin and now my entire site has disappeared. How did that happen and how do I fix this?

  4. mrmbsanchez
    Member
    Posted 1 year ago #

    s_ha_dum,
    No my custom page template does not contain a loop. I changed the header.php, footer.php in a theme I copied from TwentyTen and renamed and registered. My default page (page.php) has been changed to homepage.php via the Pages > Edit > Page Attributes Template drop down menu. The homepage.php contains a get_header and get_footer and a main content div. Nothing fancy just tags for text, however some of the divs have are positioned absolute and relative to each other.
    -Mike

  5. s_ha_dum
    Member
    Posted 1 year ago #

    @Buzz-Team, yours is not the same problem. Start you own topic.

    @mrmbsanchez, if you don't have a Loop you won't get any content from the visual editor. You need to have that part.

  6. mrmbsanchez
    Member
    Posted 1 year ago #

    s_ha_dum,
    Thank you. I replaced the content in my homepage.php with the copy of what was in the default twenty ten page.php. Then I took the main content div and tags and place them in the HTML tab instead of the Visual Tab of the WP Editor. It seems that the contain id in the page.php page, now my homepage.php, is the "wrapper" for the main content area that I want to be able to edit:
    <div id="container">
    <div id="content" role="main">
    <?php
    /* Run the loop to output the page.
    * If you want to overload this in a child theme then include a file
    * called loop-page.php and that will be used instead.
    */
    get_template_part( 'loop', 'page' );
    ?>
    I placed my div tags and content here, inside the content id
    </div><!-- #content -->
    </div><!-- #container -->

    I'm not familiar with the role="main", is this a WP specific parameter or HTML 5?

    Once the HTML is in place it must get stored in the MySQL database and The Loop will then pick it up for display in the Visual Tab. Now my users can use the Visual Tab to edit the content on the page.

    I'll finish making my changes and testing and let you know how it goes.
    -Mike

  7. s_ha_dum
    Member
    Posted 1 year ago #

    I'm not familiar with the role="main", is this a WP specific parameter or HTML 5?

    All of the markup is HTML. So far as I have noticed, WordPress doesn't make up its own markup, and I have seen a fair bit of that.

Topic Closed

This topic has been closed to new replies.

About this Topic