This method was created for SEO edits on the Bitrix site (generated h1 values were entered in the file and displayed in the template). Today I returned to this solution for canonical edits, here is the code and description: <?php include($_SERVER['DOCUMENT_ROOT']."/seo.php"); if(isset($seoh1) AND $seoh1!='') {echo $seoh1;} else {echo $heading_title;} ?> …
Read More »Articles
How to display gc_breadcrumbs in WordPress theme
If the site uses a theme not with default breadcrumbs, but with gc_breadcrumbs, and you use custom post types, then there may be a problem when breadcrumbs are not displayed on the site. Here is the code that allows you to display the plugin anywhere in the site template: <?php …
Read More »How to add a new menu area in wordpress
In the process of customizing templates, it is often necessary to add and display a new WordPress menu. To do this, you need to paste the following code into functions.php: function wpb_custom_new_menu() { register_nav_menu('my-custom-menu',__( 'My Custom Menu' )); } add_action( 'init', 'wpb_custom_new_menu' ); If you need to add multiple areas …
Read More »Error Not Acceptable An appropriate representation of the requested resource could not be found on this server.
After transferring the site to another host and trying to save changes in the admin panel, for example, such a code: <p class="block"> <svg xmlns="http://www.w3.org/2000/svg" width="700" height="72" viewBox="0 0 700 72"> <text x="0" y="70">Stroked text</text> </svg> </p> I get an error: Not Acceptable An appropriate representation of the requested resource …
Read More »Text with border/border around text in css
This article describes two options for decorating text with a border around the text along the path of the same text. There are, of course, more of these options. But I usually use the ones listed below. Example 1, crappy: using the text-shadow property text-shadow: 1px 0 0 red, -1px …
Read More »How to change the width for Vk and Facebook widgets from pixels to percentages
Very often I need to replace a narrow widget, which for some reason is assigned to VKontakte with a fixed width of 300px, with a percentage, for example 100% – in order to be displayed on the entire width of the side column. The solution is simple, make changes to …
Read More »How to show hidden files in Finder?
By default, the Finder does not show any files or folders that begin with a dot. To allow Finder to show hidden files, run the following command in the console: defaults write com.apple.finder AppleShowAllFiles TRUE ; killall Finder To hide the display of hidden files again, use the command: defaults …
Read More »On_sent_ok not working in Contact Form 7
If your site uses the old version of WordPress and the Contact Form 7 plugin, it is enough to use the code in the Advanced settings tab: on_sent_ok: "yaCounterXXXXXXXX.reachGoal('mygoal');" Where XXXXXXXX is the counter ID in Yandex Metrika, mygoal is the name of the goal that was previously created in …
Read More »How to recursively replace a domain, word, or phrase in a database
I describe this task using the example of a transferred WordPress site to another folder of another domain. To implement it, you need to search the database by domain name, you will see in which tables there are records with this domain. Then make a SQL query in the format: …
Read More »How to host Wp site in a separate folder of the domain
This article is about moving a site to an internal folder of another site. 1. Transfer site files to a new folder. 2. Export the database, in the dump change the old domain to the new one (with the folder name). For example, newdomainname.com/folder (Important! Do not put a slash …
Read More »