First, install the Breadcrumb NavXT plugin. To display breadcrumbs anywhere in your template, use the code to copy-paste into your theme files: <div class="breadcrumbs" typeof="BreadcrumbList" vocab="http://schema.org/"> <?php if(function_exists('bcn_display')) { bcn_display(); }?> </div>
Read More »Wordpress
Sorry, you are not allowed to continue in the WordPress
If you see an error like this when logging in to /wp-admin/ or /wp-login.php If you are sure that you didn’t do anything wrong and “it broke itself”, then use FTP to enter the /wp-content/plugins/ folder, look for the wp-cerber folder there and rename it, then try again to enter …
Read More »How to add custom CSS for WordPress admin panel
If you need to place a few CSS lines for the admin panel, then edit the file functions.php at the root of the theme, and add it to the end of the file: add_action('admin_head', 'admin_styles'); function admin_styles() { echo '<style> .update-nag {display: none !important;} </style>'; } Instead of the .update-nag …
Read More »Error installing plugins – sprintf(): Too few arguments in class-bulk-upgrader-skin.php
I got this error after installing a third-party free theme. Full text of the error: Warning: sprintf(): Too few arguments in /wp-admin/includes/class-bulk-upgrader-skin.php on line 152 Here is the solution – in the file /wp-admin/includes/class-bulk-upgrader-skin.php find and replace this code: if ( $this->result && ! is_wp_error( $this->result ) ) { if …
Read More »Popup image on click without href
A very elegant solution, with which the image will not be wrapped in <a href=””></a>, image will float on click to the center of the screen and will be able to close both on the top cross and on a click on a translucent background. Image code: <div class="image__wrapper"> <img …
Read More »How to display search form in WordPress theme
First you need to check if the file searchform.php exists in the root of the site theme. The content of this file should be like this: <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ) ?>" > <label class="screen-reader-text" for="s">Search: </label> <input type="text" value="<?php echo get_search_query() ?>" name="s" id="s" /> …
Read More »How to display wordpress menu anywhere in your theme
This code can be inserted anywhere in the template to display the menu. In this task, I change the standard directory menu to a custom menu. wp_nav_menu( [ 'menu' => 'Website navigation' ] ); Replace Website navigation with your name for the menu you want to display.
Read More »How to change text for Add to Cart button for Woocommerce
This task can be solved by editing the translation files of your theme. But you can use a hook that allows you to rename the “Add to Cart” button faster. In the file functions.php add the following code: add_filter( 'woocommerce_product_single_add_to_cart_text', 'tb_woo_custom_cart_button_text' ); add_filter( 'woocommerce_product_add_to_cart_text', 'tb_woo_custom_cart_button_text' ); function tb_woo_custom_cart_button_text() { return …
Read More »How to remove unused tabs for product editing in WordPress admin panel
By default, the product edit page has several tabs that are never used for simple stores. In this article, the code you need to put in functions.php in your theme folder. In this example, the Deliveries tab is removed, but you can uncomment any line and the tab that you …
Read More »How to add Woocommerce product categories to WordPress menu
It’s time for serious questions and quick answers. If you do not see Product Categories to add to the menu, then you need to click on the “Screen Settings” button in the WordPress panel and check the box Product Categories. Finita.
Read More »