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 »Articles
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 »How to hide unwanted menu items in WordPress admin
When there is a case – disable unused or system sections and tabs in the admin panel on the left, you can use this code for functions.php with a description in the comments: add_action('admin_menu', 'remove_admin_menu'); function remove_admin_menu() { //remove_menu_page('options-general.php'); // Delete the Settings section remove_menu_page('tools.php'); // Instruments remove_menu_page('users.php'); // Users …
Read More »How to make CSS fractional list for ul li
To display the content of the article, it is not enough to display standard nested lists, because the view will be like this: 1 1 2 3 4 2 1 2 3 4 3 1 2 3 4 I need this view to be like this (the nested sub-items are …
Read More »How to get a link in an email where the form is filled out via Chronoforms
This task is very simple, for normal CMS. For Joomla, I publish the solution in this article. In the Designer tab, add Custom Code Pure Code – Yes checkbox In the Code line add this one: <input type='hidden' name='page_url' id='page_url' value='<?php echo \JURI::getInstance()->toString(); ?>' /> To display a link in …
Read More »Find anchor in URL and scroll to its id on this page using JS
Here is a case: if a link contains a word, then direct the user to some anchor on the page. I needed this for ChronoForms in Joomla – when filling out the form, the page was updated, and it was necessary to return the user to filling out the form …
Read More »Automatically text replacement via WordPress function
Someday I will describe the way of creating a multisite for WordPress without database clones and installing plugins. But in this article I am describing a solution when several sites work with the same database and with the same admin panel, and for example, for a subdomain I need to …
Read More »