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://frecer.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 Security Web Wordpress
How to make all pages permanently SSL.WordPress
Has SSL been installed on your website? The introduction of SSL is recommended for all websites because of its security and SEO advantages. Full-page SSL is particularly desirable for shopping and crowdfunding websites where personal data and payments are involved....
Continue readingCode Security Web Wordpress
How to prohibit access to wp-config.php.WordPress
Prohibiting access to wp-config.php improves site security. You are encouraged to refer to this information to maintain your website. Put the following code in the “.htaccess” file. <files wp-config.php> order allow,deny deny from all </files>
Continue readingCode Web Without Plugin Youtube
How to make YouTube embedding responsive while maintaining proportions with CSS.
Learn how to make YouTube embeds responsive while maintaining the ratio. 1. 1:Add div tag.2. 2:Add css.3. Finalise. 1:Add div tag. Add a div tag to enclose the iframe tag. <div class="yt"><iframe width="560" height="315" src="https://www.youtube.com/embed/YUDbl9qBihk?si=RRyI62O5tVSEfHvo" title="YouTube video player" frameborder="0" allow="accelerometer;...
Continue readingPlant
What is Gymnocalycium vatteri?
Gymnocalycium vatteri is a cactus of the genus Gymnocalycium. Native to Argentina-Uruguay in South America, it is rich in varieties and delights horticultural enthusiasts. All of these are seedlings with a tangle of local globe seedlings. It was kept in...
Continue readingCode 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 readingPlant
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 readingPlant
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 readingNews NGO
Non-governmental organization established.「DAIKICI NGO」
Today, the non-governmental organisation “DAIKICI NGO” was established. The aim is to grow and advance humanity while working to solve problems across the globe, whether local, national or international. There are many problems and challenges, but we want to work...
Continue readingPlant
Obregonia denegrii.
One genus and one species of cactus, so majestic and dignified is its appearance that it is known as the ‘TEIKAN’. This is a very rare cactus and one of the most popular cacti, partly because of its beautiful rosette...
Continue readingCode Web Wordpress
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. /*...
Continue reading