Require title for pages

Start with downloading the plugin called Force Post Title. Here’s the plugin with one row (2 with the comment line) added to the bottom, based on our comments. What happens is that a small jQuery script is added to the page Create Post/Page. The script will check if the title field is empty when the … Read more

Problem in wordpress with “-“

Background: WordPress converts normal dash (-) to long dash (–), straight quotes to curly quotes and some other similar symbols and punctuations to their printer friendly versions using wptexturize. Generally it’s recommended to leave them up to WordPress. However, occasionally, we may want to override this behaviour. For example, in case we are writing Programming … Read more

Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg

I used this, inline, on specific pages (using get_current_screen()). I’d hoped this would enable me to hide/show the permalink panel under certain conditions. However, removeEditorPanel() removes the permalink panel globally. This isn’t completely horrifying, since the css still works conditionally, and the permalink can still be edited via the editor (by clicking on the title) … Read more

How to prevent apostrophes and quotes from appearing in permalinks?

In WordPress, “—” and ” — ” become em-dashes (— —) and “–” becomes an en-dash (— #8212;). The sanitize_title_with_dashes() function doesn’t catch these. That function uses the databased copy, but the title displayed to the user always goes through a texturize function. So if we replace en/em dashes on their way into the database, … Read more

How do we remove the H3 tag for the reply-title I.D

Today there is a native option to do this without hacking the core, or doing tricky filters with output buffer. You just need to use the filter ‘comment_form_defaults’ and edit the values from ‘title_reply_before’ and ‘title_reply_after’ key: add_filter( ‘comment_form_defaults’, ‘custom_reply_title’ ); function custom_reply_title( $defaults ){ $defaults[‘title_reply_before’] = ‘<span id=”reply-title” class=”h4 comment-reply-title”>’; $defaults[‘title_reply_after’] = ‘</span>’; return … Read more

Remove description from on Home

wp_get_document_title() has some interesting filters – pre_get_document_title and document_title_parts. /** * Filter the parts of the document title. * * @since 4.4.0 * * @param array $title { * The document title parts. * * @type string $title Title of the viewed page. * @type string $page Optional. Page number if paginated. * @type string … Read more

Remove post title input from edit page

You can do this : add_action(‘admin_init’, ‘wpse_110427_hide_title’); function wpse_110427_hide_title() { if (current_user_can(‘subscriber’)) remove_post_type_support(‘post’, ‘title’); } This would hide title for subscriber. Replace ‘post’ with your custom post type

Is there a way to override the tag specified in header.php?

First, let’s change your <title> to <title><?php wp_title(‘ | ‘, true, ‘right’); ?></title> Because adding to the title string in that was isn’t very future-forward, instead it’s best to use a filter to do any modifications to the title. So let’s instead ad (in functions.php): add_filter(‘wp_title’, ‘my_custom_title’); function my_custom_title( $title ) { // Return my … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)