How to save rewriting links.WordPress

If you are building multiple WordPress sites, you face the problem of having to ‘rewrite URLs’ when duplicating them.

The following code is recommended to solve this problem before it happens.

Please describe it in the theme’s ‘functions.php’ file.

/* Description in functions.php */
add_shortcode('url', 'shortcode_url');
function shortcode_url() {
return get_bloginfo('url');
}
add_shortcode('tdir', 'tmp_dir');
function tmp_dir() {
return get_template_directory_uri();
}
add_shortcode('cdir', 'child_dir');
function child_dir() {
return get_stylesheet_directory_uri();
}

If the above is done,

https://daikici.com・・・Used to describe links within a page.
[tdir]・・・Used to reference images in the theme file (parent theme).
[cdir]・・・Used to reference images in theme files (child themes).

This can be used in the form of.

Code Speed Web Without Plugin Wordpress

Without plugins!How to use syntax highlighting Prism.js.|WordPress

In this article, we will show you how to implement syntax highlighting in WordPress without using a plugin. Syntax highlighting is often used to display source code on websites and blog sites. This website has adopted “Prism.js” after various trials....

Continue reading

CDN Security Speed Web

Does CDN delivery with Cloudflare reduce AdSense revenue?Various setting methods.

1. The impact of Adsense.2. The cause is that individual IPs are indistinguishable through Cloudflare (they are all the same IP through Cloudflare).3. How to make Nginx recognise individual IPs differentially.4. How to make apache recognise individual IPs separately. The...

Continue reading

Code Web Without Plugin Wordpress

Without plugins!How to display a blog card with internal and external link support.|WordPress

Learn how to display blog cards in WordPress without using a plugin. Plug-in non-use has various advantages, such as reducing server load and maintaining site display speed. WordPress has a large variety of plugins, but you want to customise it...

Continue reading

Plant

Cool and easy to grow Gymnocalycium Origin, origin and how to grow.

Gymnocalycium is one of the most robust species to manage. It is a cool and varied species with a very good balance of both ornamental and collecting value. 1. Origin2. Habitat3. Features4. Type5. Farming Origin Derived from the Greek ‘gymnòs’...

Continue reading

Plant

What is a cactus. Origin and characteristics of ‘Cactos’ [1].

The word ‘Cactus’ derives from the Greek word ‘Kàktos’. The term was used by Theophrastus in his book HistoriaPlantarum to describe ‘unknown thorny plants’. The term ‘Cactus’ was subsequently adopted by the renowned botanist Linneo to define the American thorny...

Continue reading

Code Web Without Plugin Woocommerce Wordpress

Without Plugin!How to display just any item on the Woocommerce My Account page.

The items on the Woocommerce My Account page vary depending on the products handled and the site they are on. For example, if you want to hide the ‘Dashboard’ and ‘Downloads’ items, you can achieve this by doing the following....

Continue reading

Code Speed Web Without Plugin Wordpress

Without Plugin!No plug-ins! How to implement a table of contents.|WordPress

Learn how to implement a table of contents in WordPress without using a plugin. This method does not use JQuery and is also the implementation method introduced on this website. It takes less time and man-hours, if you like. The...

Continue reading

Plant

Copiapoa cinerea var. cinerea

Copiapoa cinerea is known as the ‘white cactus’ and is arguably the most popular cactus in Japan. Individuals with particularly white skin and pitch-black spines fetch high prices. 1. Synonym2. Origin3. Habitat4. Description5. Farming6. Way of increasing Synonym Below are...

Continue reading

Code Web Without Plugin Wordpress

Without Plugin!Easy copy and paste. how to add a site name shortcode to WordPress.

It is very time-consuming to rewrite site names when producing multiple sites. As a way of preventing this from happening, it is recommended to set up a system to call the name of the site by a shortcode. Write the...

Continue reading

Code Speed Web Wordpress

How to score 100 on the Google Speed Test.How to create better web vitals with WordPress themes and plugins. ‘Checklist for developers’.

This post explains how to get a score of 100 on the google speed test. 1. 1.Files2. 2.Fonts and typography3. 3.CSS framework4. 4.Conditional asset loading4.1. Inline styles4.2. Inline scope4.3. Using transients to store conditions4.4. Checking by name for loading5. 5.Image...

Continue reading

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.