$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Keep WYSIWYG on Blog Page|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Keep WYSIWYG on Blog Page

matteradmin10PV0评论

I want to use the WYWISWYG on my blog page for an introduction text, but can't seem to bring back the WYSIWYG Editor on the page the page I defined as my blog posts page.

Is there any way to force WP to still show the WYSIWYG on the Blog posts page?

I want to use the WYWISWYG on my blog page for an introduction text, but can't seem to bring back the WYSIWYG Editor on the page the page I defined as my blog posts page.

Is there any way to force WP to still show the WYSIWYG on the Blog posts page?

Share Improve this question asked Jan 7, 2019 at 21:50 Fredy31Fredy31 8782 gold badges16 silver badges31 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 3

Pre WP 4.9

if( ! function_exists( 'fix_no_editor_on_posts_page' ) ) {

    /**
    * Add the wp-editor back into WordPress after it was removed in 4.2.2.
    *
    * @param Object $post
    * @return void
    */
    function fix_no_editor_on_posts_page( $post ) {
        if( isset( $post ) && $post->ID != get_option('page_for_posts') ) {
            return;
        }

        remove_action( 'edit_form_after_title', '_wp_posts_page_notice' );
        add_post_type_support( 'page', 'editor' );
    }
    add_action( 'edit_form_after_title', 'fix_no_editor_on_posts_page', 0 );
}

WP 4.9

if( ! function_exists( 'fix_no_editor_on_posts_page' ) ) {

    function fix_no_editor_on_posts_page( $post_type, $post ) {
        if( isset( $post ) && $post->ID != get_option('page_for_posts') ) {
            return;
        }

        remove_action( 'edit_form_after_title', '_wp_posts_page_notice' );
        add_post_type_support( 'page', 'editor' );
    }

    add_action( 'add_meta_boxes', 'fix_no_editor_on_posts_page', 0, 2 );

}

Full Details Here

If you want a quick manual fix-

The problem is that the page's content is currently empty.

  1. Switch the page for posts to a temporary page,
  2. edit the original page and add some content,
  3. save,
  4. set the page for posts page back to the original page.

You'll now be able to edit it whenever you want, as long as you don't empty it again.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far