List Posts by Category In Navigation

WordPress is primarily a blog platform. Not infrequently it is used as a CMS. But not just static pages play a role, but also posts, because they are giving more opportunities, having better performance and be published in feeds. Therefore, I prefer to use, in the context of WP as a CMS, posts more than the static pages. From time to time are the wishes of a navigation layout very extra odinary. And so was it in my recent project, the requirement to list the posts from each category in the navigation.
This is unusual as in the long run, you will have many posts, and the navigation will be very confusing - still, in this project it made sense, since we won't have many posts.

The small function lists the category and below the posts. There is a parameter that restricts the output of the posts, so that in extreme cases, not too many will be listed, only the last posts - $mylimit. The value -1 for this parameter provides all posts. The function itself belongs to the functions.php of the theme or in a Plugin. An exemplary use can be found below the function.
Continue reading …

Disable HTML Editor In WordPress

In contrast to the visual editor in WordPress, you can not disable the HTML editor. WordPress does not provide a user setting or a global option. Also, there is no hook, to disable the HTML tab above the editor when writing posts or pages.

But there are users who do not need this tab and like to deactivate it globally. Therefore, I have a solution, how you can disable it in your editor.
Alternatively, you can use the Plugin Adminimize, which offers such a possibility per role, just put it in the settings.
Continue reading …