The product name in WooCommerce is no different from the title of the post in the Posts and Pages. Therefore, to display the WooCommerce product name anywhere in the template, add the code: <?php the_title(); ?>
Read More »How to display the Nextgen Gallery
On this page I publish shortcodes to insert into an article, or into a template. Option 1 – default: [ngg src="galleries" ids="1" display="basic_thumbnail" thumbnail_crop="0"] Option 2 – show multiple galleries: [ngg src="galleries" ids="1,3" display="basic_thumbnail" thumbnail_crop="0"] Option 3 – displaying images by tags: [ngg src="tags" ids="primertega" display="basic_thumbnail" thumbnail_crop="0"] Option 4 – …
Read More »Canonical for pagination in Opencart below version 3
Pagination pages may not have canonicals at all by default. To add their automatic generation, open the file /catalog/controller/product/category.php and in it after the line $this->load->model(‘tool/image’); add the following code: if (isset($this->request->get['page'])) { $page = $this->request->get['page']; $pathx = explode('_', $this->request->get['path']); $pathx = end($pathx); $this->document->addLink($this->url->link('product/category', 'path=' . $pathx ), 'canonical'); } …
Read More »Redirect 301 from https to http
This is one of the examples of the implementation of redirection from https to http. RewriteEngine on RewriteCond %{HTTP:HTTPS} =on [NC] RewriteRule ^(.*)$ http://domainname/$1 [R=301,L]
Read More »Include the file and generate title
It happens that the generated data is stored in a separate file. And the task is to output, for example, titles with a preliminary check of already existing values (not empty) in a third-party file. An example of the implementation is below: <?php include($_SERVER['DOCUMENT_ROOT']."/seo.php"); if(isset($seoh1) AND $seoh1!='') { echo $seoh1; …
Read More »How to make a PDF file available for download
If you do not need to make PDF files available for viewing, but want to publish them only for download, you can immediately register the property so that then the files will be downloaded immediately. Example: <a download="" class="tda-link gradient-text" href="/docs/file.pdf">Download PDF file</a>
Read More »Remove page=2 from canonical links for Opencart 3
The developers decided that in Opencart 3+ for SEO it would be very useful to add a link to the current page as canonical, even if it is a pagination page. This is an awful SEO solution, so you need to make some changes. So, you need: from <link href=”https://domain/path?page=2 …
Read More »Title for bitrix pagination
I will not describe why this is necessary, I will only publish a ready-made solution. else echo $APPLICATION->ShowProperty("meta_title"); if (isset($_GET['PAGEN_1']) && $_GET['PAGEN_1']!=1) { echo " Page ".$_GET['PAGEN_1']; } if (isset($_GET['PAGEN_2']) && $_GET['PAGEN_2']!=1) { echo " Page ".$_GET['PAGEN_2']; } if (isset($_GET['PAGEN_3']) && $_GET['PAGEN_3']!=1) { echo " Page ".$_GET['PAGEN_3']; } The disadvantage …
Read More »How to place a favicon on a website
If you’re using a site with a CMS, you probably already have a default favicon that you’ll want to change. To do this, you need to search for the favicon.ico line in the source code, and you will see in which folder the current favicon is loaded. The easiest method …
Read More »How to display a shortcode in a WordPress theme
Shortcodes make our life a lot easier, they are often generated by plugins and all we have to do is display the shortcode in the WordPress theme. Use code like this: <?php echo do_shortcode( '[shortcode]' );?> Where instead of shortcode write your shortcode name, and do not forget about the …
Read More »