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 »Open expanded block by link in accorderon/spoiler/toggle
The case can be like this – for example, from the main page you need to place links to an internal page where a list of questions and answers is placed. On the inner page, the link should expand the answer to a specific question. The solution is here: HTML …
Read More »How to display a product property in Bitrix only for a specific user group
By default, the properties are displayed, for example, in this file /bitrix/templates/template/components/bitrix/news.detail/catalog/template.php like this: <?if($arResult["PROPERTIES"]["test123"]["VALUE"]):?> <div class="project-top__parameter-item"> <div class="project-top__parameter-name"> <?=$arResult["PROPERTIES"]["test123"]["NAME"]?> </div> <div class="project-top__parameter-line"></div> <div class="project-top__parameter-size"> <?=$arResult["PROPERTIES"]["test123"]["VALUE"]?> </div> </div> <?endif;?> where test123 is a product property. If you need to hide this property for all groups, for example, except for Admins …
Read More »Joomla 1.5 admin panel in Virtuemart does not open sections and icons are not loaded
Today I got this problem on an old project where the entire admin panel worked correctly, but for Virtuemart all links looked like http://domain.ruadministrator/index.php?pshop_mode=admin&page=product.product_list&option=com_virtuemart. There should be a slash after the domain, but there is no slash, and therefore all Virtuemart sections in the admin panel do not work. An …
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 »How to display content for a particular URL in a template in Cs Cart
Below is an example similar to the standard PHP if echo: {if $config.current_url == "index.php?dispatch=_no_page" } {else} <meta property="og:url" content="{$config.current_url|fn_url}" /> {/if}
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 »