Saturday , February 22 2025

Webmaster notes

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 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 »

How to get value from ACF plugin field

The ACF plugin is needed to create and display additional fields for articles. For example, we need to add the color field to articles and display it in the template. The procedure is standard: go to Plugins – Add new – search for ACF (Advanced Custom Fields), install and activate. …

Read More »

If the link contains the word

The case: If a word occurs in the URL, then you need to display some text. For example, if the URL contains “hahaha”, then on the page you need to display the text “description of the text hahaha”. PHP solution: <?php if(strpos($_SERVER['REQUEST_URI'], 'hahaha') !== false){ echo "description of the text …

Read More »

How to display Breadcrumb NavXT in WordPress theme

In this article, I do not want to describe the detailed process of installing the Breadcrumb NavXT plugin, but if someone really needs it: Go to the WordPress panel in the Plugins section – Add New. Search for Breadcrumb NavXT, install and activate it. This plugin will not be automatically …

Read More »