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 »301 redirect to https via WordPress function
I don’t remember why I needed this solution at all, most likely because of infinitive redirects after editing .htaccess file. Below is a redirect option via functions.php: function force_https () { if ( !is_ssl() ) { wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 ); exit(); } } add_action ( 'template_redirect', 'force_https', …
Read More »How to display any module in the text of the material in Joomla
The case is simple – in the text canvas, display some module. The implementation is also simple: In the Plugins section, make sure that the Content – Loading Modules plugin is enabled, then edit the material and add this: {loadmodule module_name} where instead of module_name write the name of the …
Read More »301 redirect to https for WordPress multisite
The multisite mode in this case is when the main domain and its subdomains work in the same base and the subdomains are a mirror of the main site. If I add a standard 301 redirect to .htaccess then subdomains via http subdomains start redirecting to the main site. This …
Read More »Display video instead of preview in K2 Joomla category
The task is to display a video instead of a preview of the K2 material in the general output of materials in the category. here wrote about how to display a video from YouTube instead of a picture of the K2 material inside the material. To display images in categories, …
Read More »Display video instead of preview in K2 Joomla material
The task is to display a video from YouTube on the K2 material page instead of the uploaded image. The output of the image on the site is like this: <?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?> <!-- Item Image --> <div class="itemImageBlock"> <span class="itemImage"> <a class="modal" rel="{handler: 'image'}" href="<?php echo $this->item->imageXLarge; …
Read More »