WordPress is about to become an increasingly complete application framework, but the modest post editor is still the interface area where users spend most of their time. This is part of a significant improvement in the back end over the past few years. Although the recent transition from WordPress 3.9 to TinyMCE version 4.0 is a highlight, there is still much room for improvement. One of the most common problems users encounter in the editor is that they must constantly switch between edit mode and preview mode to determine what the content actually looks like. In this article, we will discuss the right issues and analyze how to customize the word press text editor to make it look like a front-end design and work. The
Why customize the editor? When you are busy drafting the initial draft of a post or page, you will finally think of the final look and feel of the text. The important thing is to clear your mind and cover the canvas as gracefully as Steven Pressfield. However, the fact that the content exists in the context becomes more important as the content gradually transitions to the serious business of \
If the article displays a pop-up window to update oneortwo lines, it is recommended that you review the changes before clicking publish. Similarly, this is useful if you need to proofread the article thoroughly before submitting it for review. Far from the above are the daily cutting and thrust that make up the main platform. In fact, when you work in a long format over a potentially slow remote connection, it quickly becomes a big problem for two important reasons. Switch context: writing goes into the groove. Once there, he wants to stay there. Continuous switching between browser windows and various visual contexts is an obstacle to concentration and flow. Time: all roundtrips between the editor and the preview window will be summarized within the working week. Please test by yourself. Record how often tabs are toggled the next time you work. Time used to grind the actual content. If you customize the edit screen to match the front display, you do not need to continue the preview operation. It makes the editor a more real WYSIWYG tool. The
For example, given the sufficient line height and font size used by the theme (as you can see in wpmu DEV), you may be concerned that some paragraphs will not be too long. If you customize the publication editor, the frontmost screen will display the final results as you enter. If you spend more time customizing the backend, it is also worth pointing out the following main benefits: It is much easier for non-technical team members to immediately enter content in a familiar context. When preparing a site for an external client to access WordPress for the first time, adding the site provides good advanced finalization. How about front-end editing? At this point, some of you can ask: How about the front-end content editor? Isn’t that what they designed to do? Also, did you say that in the next version of the text imprinter, as a core function, there is a built-in front-end editing plug-in? The
That’s a good question. Take one at a time. The front-end editor is a popular feature and is driven by WordPress competitors such as squarespace and Weebly. The biggest advantage of this editor is that users without technology can directly interact with the website content to make changes. This can be perfect if you only want to make minor changes to existing parts of the content, usually by less experienced administrators or
It is easy to use when the site owner is assumed to be set up correctly. The downside is that these solutions typically provide a limited range of capabilities. This is true from the point of view of the lack of access to advanced article features such as the editor itself and the meta box. They also create barriers between the functionality that you and other back-end administrators provide. The
Then there are editing workflow and control issues. Front end editors are great when people want to go there and make changes immediately, but not always. The last problem is complexity. Configuring a powerful front-end editor is not easy. Many of the best plug-ins on the market mean that different levels of charge dependency are added to the settings, and worry about future compatibility with other parts of the theme. In short, this is a complex problem. Many of us want to reduce complexity on the core of word press, including the front end editor plug-in. The
Sadly, after the initial excitement, that hope was doomed to break. Front end editing plug-in of text printer. From the end of 2013 to the end of November 2014, the plug-in is under active development as a functional plug-in. That is, it will eventually be released to the core. Unfortunately, the project was stopped and moved to the list of inactive feature plug-ins. Sadly, it is said that sooner or later you will not see that the core side is safe. If you want to use the front-end editor, it is recommended that you try the front-end editor (free) or visual composer (charged), but please note the potential problems mentioned above. The
Instead, in this article, the approach we will take provides a simple way to bypass these obstacles and reduce to the current problem. Let the content sing. Let’s start implementing it. Stage setting all websites will naturally have very different themes from other content. For the purposes of this article, we will remove items to provide a clear understanding of the basics, and you are free to apply the specific requirements of your own settings. We use the local settings of WordPress, and start with the WordPress theme unit test data version to introduce the key points. If you start customizing your environment, this approach has several obvious advantages: The
In local development, you can experiment freely without disturbing users or colleagues. Word press theme unit test data provides a set of reasonably configured core content that can be tested for changes. This is the perfect platform to launch when front-end and back-end navigation changes all types of topics. In our case, we and import the starter pack from the WP test installed in the new local WordPress, and then select twenty five as the theme. This allows you to immediately use multiple well configured pages, such as callouts, formatting, and image alignment. The
‹ label and format page of WP test. If you are doing so, you can copy this method or use the current site content to activate a unique theme in your local installation. The former is recommended as the initial stage. The content provided by WP test is a good way to check how complete the style of the current theme is before starting major changes. To understand the internal situation, we now have appropriate sample content to view, so before customizing the editor itself, let’s take a moment to understand what actually happens inside word press. As mentioned above, the WordPress standard provides an open source TinyMCE editor. In other words, this is the bottom of the topic stack. The
TinyMCE display content
You have your own style sheet to control the display. By default, this is not very clear about the outside world. TinyMCE developers are smart enough to create a space to load additional stylesheets through a hook called content_css. WordPress developers affectionately wrap it up as a default function called add\u editor\u style. This is included in the version 3.0.0 to word press core. If you refer to the online documentation, this feature will include WP include \/ theme. You may notice that it is hidden in PHP. Let’s see how to call this function directly in a few minutes. By default, WordPress is an editor style that you can use to specify the style of editor content. Make sure the CSS file is in the root directory of the theme named CSS. Therefore, if you want to customize an existing theme, the first question you need to ask yourself is editor style. Whether the CSS file already exists in the theme. Take the twenty fifth topic as an example, and you may notice that it actually contains such files. If you quickly switch between the preview and administrator view of the annotation and formatting pages, you will find that the core styles are faithfully copied between environments. The text and right preview of the left editor window. Further, the style you see in the editor window is indeed edit style. Let’s check again whether it is controlled by CSS. A quick trip to the web inspector is all you need to make sure this is true. By default, the editor is edit style. Navigate to CSS. At this stage, I hope the basic plan is clear. All in all: the WordPress editor is driven by TinyMCE. TinyMCE can redefine the default style. WordPress uses a function called add\u editor\u style to specify the CSS file used to redefine the default style. By default, WordPress is the editor style of the active theme root. Navigate to the file named CSS. The next question is how to handle your own changes. The first thing to summarize is whether there is a default editor style sheet file in the root directory of the theme folder, as suggested above. If so, create a copy in the same location, custom editor style. The recommendation is called CSS. This gives you a clean place to easily restore the experiment to its original settings. If there is no file, custom editor style. Create a new file named CSS and place it in the root directory of the theme folder. The next step in customizing CSS connections is to instruct word press to find a new file instead of the default file. To call add\u editor\u style and use the new stylesheet, the functions in the topic. Add the redefinition to PHP to do this. The function of the topic. Open PHP, add and save the following lines at the end: Load summary midoriberlin\/400a2c58d26ec1033817 now let’s check whether the editor actually uses the new stylesheet. I repeat, moving quickly to the inspector is all we need to determine. As shown below, you have now successfully connected to the new file. Male editor style A custom version of CSS is loading. Now, let’s quickly change a few CSS files and select them on the back end. The first is custom editor style. Edit CSS to make its head appear charming green shadow. The header turns green. The header has been changed by adjusting the following CSS: Oriberlin\/c3ae04d4a56a00d1a650 now
Let’s add a subtle border to the image. Perhaps \tinymce is the ID automatically assigned to the male tag in the TinyMCE editor. You can view the results of this change immediately through the image sorting page. In the editor, change the image border color to pink. Although it will not be deployed to CSS showcase in the near future, in these two simple examples, it is clear that you can now fully control the content of the editor window. In addition, the pink border is generated by the following CSS: Load summary midoriberlin\/401 d88ad946526594732 from this point on, you need to view the existing CSS and check whether it matches the editor in the way that best suits your use case. By default, the existing front-end style sheet is used. If there is no existing editor style sheet to work here, you can also import the existing front-end style sheet of the site as the default style sheet. Let’s take a brief look at this method. To import an existing front-end style sheet, use custom editor style. Change the content of CSS to: Loading key points midoriberlin\/c513eb54beca37f6ff when performing tasks, it may seem a bit bad at first, but there is a solid foundation to isolate appropriate problems and operate. Further, the next step you need to take depends on how well the front-end display matches the editor. Editor style provided with twenty fifth. We recommend that you use CSS stylesheets as a starting point for mapping CSS policies. In addition, please refer to the word press documentation on how to further develop the pointer of this method by adding advanced features such as custom styles based on the post type. Before concluding, you should also mention several other TinyMCE customizations that you can browse. TinyMCE’s control buttons show a good overview of raelene Wilson. TinyMCE advanced: a plug-in for adding custom styles as buttons. Conclusion controlling the display of WordPress editor window can save the author’s time and add professional and concise beauty to the theme. Understand how styles are applied, so that you can customize more or less according to the needs of the situation. Let’s summarize the steps. The topic is edit style. Make sure it is provided with the CSS stylesheet. Create your own custom stylesheet and have word press point to it. Use an existing editor style sheet or import the default theme style by default. Please accept the shape. I hope this article can help you control your work environment. In the editor, change the image border color to pink. If you have any tips or tricks to share, please tell us the following! Labels: administrator CSS text imprint editor