The solution is so easy to follow. There is no need to edit CSS or theme files. You need to go to the Wp admin, then go to the Users > Your Profile. Scroll down to Toolbar (under Keyboard Shortcuts) and uncheck the Show Toolbar when viewing site box.
Read More »Wordpress
How to remove h3 from AAPF – Advanced Ajax Product Filters (Rocket)
This article is about how to remove unused h3 tags, but not completely – just replace them to div tags. To solve this problem, you need to add this code to functions.php: add_filter('BeRocket_AAPF_template_full_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1); add_filter('BeRocket_AAPF_template_full_element_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1); function some_custom_berocket_aapf_template_full_content($template_content) { $template_content['template']['content']['header']['content']['title']['tag'] = 'div'; return $template_content; }
Read More »Css styles for WordPress admin in functions.php
If you need to add individual styles, and they are only a couple of lines, you can add them directly to functions.php: add_action('admin_head', 'webinp_style'); function webinp_style() { print '<style> tr[data-slug="to-top"] {display: none !important;} </style>'; } Between <style> and <style> you need to write your own CSS styles.
Read More »How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section
I tried solutions with functions that should remove from head and , but a very simple solution solved the problem: remove_action( 'wp_head', 'wp_resource_hints', 2 ); You need to place it in functions.php.
Read More »How to remove the redirect to the main domain for its aliases in WordPress
For multisites, the case of creating site mirrors that open the contents of the main site is relevant. By default, all mirrors are redirected to the main domain. To disable it, you need to add two lines at the end of the wp-config.php file: define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']); define('WP_HOME', 'https://' …
Read More »How to add a short product description in a WordPress category
If you need to add a description of a product in the list of products in a category, you can use this solution: In the file /wp-content/plugins/woocommerce/templates/content-product.php find the line do_action( ‘woocommerce_shop_loop_item_title’ ); and under this line add the following code: ?> <div itemprop="description" class="introdesc"> <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt …
Read More »How to add any text at the end of the menu in WordPress
Now many templates include menus with 100 percent width, and then there is a case – for example, place icons on the right, or insert contacts for mobile devices in the opening menu block. There is a function to implement: add_filter( 'wp_nav_menu_items', 'my_custom_menu_block', 10, 2 ); function my_custom_menu_block ( $items, …
Read More »Single robots for multidomains on WordPress without plugins
This article is a continuation of multisite cases on WordPress. Here is an example of replacing the standard robots.txt with a multisite one. 1. If robots.txt file has already been created, rename it or delete it. 2. In .htaccess add the line: RewriteRule ^robots.txt$ robots.php 3. Create a robots.php file …
Read More »Popup images not working in WordPress Total theme
Description of the problem – pictures pop up using all kinds of carousels from Total theme, but when customizing the output of a pop-up thumbnail for a blog (see example below), these pictures did not pop up with class=”wpex-lightbox”. The problem is that Total theme scripts are not displayed on …
Read More »How to get link to post thumbnail in WordPress
It makes no sense to add a task description, so I just add the code below: $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true); echo $thumb_url[0];
Read More »