Simple comments spam solution

If you don’t want people filling website field, simply remove it from the form. Put this code in functions.php of your current theme: function wpse_remove_comment_url($fields) { unset($fields[‘url’]); return $fields; } add_filter(‘comment_form_default_fields’, ‘wpse_remove_comment_url’); It is more logical than showing the field and advising users against using it. UPDATE To not confuse users, and fool some bots, … Read more

How to change first letter of active menu item

1. CSS ::first-letter The first option is selector CSS ::first-letter. li.menu-item.active a::first-letter { color: red; } The a tag inside menu should have display: block / display: inline-block. Note: The ::first-letter selector can only be used with block-level elements. 2. Filter nav_menu_item_title Another way is to use nav_menu_item_title filter and surround the first letter with … Read more

Deprecated error notice

The deprecated notice is pretty clear: Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. The only place you use a user level it here: add_options_page( ‘Seach by Category Options’, ‘Search by Category’, 10, basename(__FILE__), array(‘SBC_Admin’, ‘config_page’) ); See that “10”? Don’t do that. Use a role, such as … Read more

WordPress limit post that subscriber can create

This solution uses the publish post hook. What’s happening here is that when a post is published, it runs the custom post_published_limit function we create below. The $max_posts is set statically here, you can expand it to pull the value from elsewhere, but that’s beyond the scope of the question being asked. However there is … Read more

files disappearing from template

I figured it out. This is because a lot of your file request are getting a 4XX, 5XX response or can’t be loaded. I started looking further and realized some of your js/css is being loaded properly. However some of it is not. The files that are not being loaded have a :443 extension to … Read more

How to remove only images from the_content() [duplicate]

This answer already here How to remove images from showing in a post with the_content()? <?php $content = get_the_content(); $content = preg_replace(“/<img[^>]+\>/i”, ” “, $content); $content = apply_filters(‘the_content’, $content); $content = str_replace(‘]]>’, ‘]]>’, $content); echo $content; ?>