In HTML, some URL or long sentence sticks out of the parent box. The following is an example.
<div class="box">
<p>This is an example of short message</p>
</div>
<br/>
<div class="box">
<p>ThisIsAnExampleOfLongMessage</p>
</div>
.box{
width:120px;
border: 2px solid #111;
}
Result
The cause of this problem
This is because of the settings of word-break or overflow-wrap (or word-wrap). Define word break point by word-break css property or define when the browser should insert line breaks within an otherwise unbreakable string.
post_password_required() is used to protect contents (posts) with password. This function detect whether post requires password and correct password has been provided.
This function checks a post type’s support for a given feature. The first argument $post_type is the post type being checked and the second one $feature is the feature being checked.
In my case, get the post type of the current post with get_post_type(), and check if it is ‘comments’.
comment_form() is used to output a complete commenting form for use within a template.
This function is used to displays a list of comments for current post or page. The argument array $args defines default arguments and form fields to override. You can use it to change class and id names.
Reference: Parameters of comment_form() in wordpress.org
This is one of the articles about project “Create Original Theme in WordPress”.
GOAL
To create sidebar.php
Environment
WordPress 5.5.1 XAMPP 7.4.10
sidebar.php
<?php
/**
* The template used for the sidebar
*@package WordPress
*@subpackage Techblog
*@since Techblog 1.0
*/
?>
<?php if ( is_active_sidebar('sidebar') ) : ?>
<aside id="sidebar">
<?php dynamic_sidebar('sidebar'); ?>
</aside>
<?php endif; ?>
functions.php
‘widgets_init’
‘widgets_init’ is the hook to initialize widgets such as sidebar. You should hook the register function register_sidebar() with add_action(). Please check the article “What is Hook in WordPress?” for detail about hook in WordPress.
In my case, techblog_widgets_init() is the function to register sidebar.