WordPress 4.9.1 Correct posture for adding record number

There are many articles on the Internet about how to add filing in WordPress, but it is not suitable for the 4.9.1 version. Most of the solutions provided are to modify the code in the foot.php file in the theme directory, but the 4.9.1 version does not Be applicable. The correct addition posture is as follows:

1. Go to the background of the website to add your own filing information, which is no different from the previous version. Go to Background -> Settings -> General Settings. Here you will see the ICP record number input box, fill in your record information.
write picture description here
Click Save Changes. At this time, the filing information will not be displayed at the bottom of the web page, and you need to continue with the next steps.

2. Find the side-info.php in the directory of the theme you are using, for example, I use the directory wp-content/themes/twentyseventeen/template-parts/footer/ of the main body twentyseventeen. This is the most important, because most of the previous blogs provided solutions to find home.php or index.php in the /wp-content/themes/twentyseventeen/ directory.

Posted on February 3, 2018 by root
WordPress 4.9.1 The correct posture for adding a record number

There are many articles on the Internet about how to add filing in WordPress, but it is not suitable for the 4.9.1 version. Most of the solutions provided are to modify the code in the foot.php file in the theme directory, but the 4.9.1 version does not Be applicable. The correct addition posture is as follows:

1. Go to the background of the website to add your own filing information, which is no different from the previous version. Go to Background -> Settings -> General Settings. Here you will see the ICP record number input box, fill in your record information.

Click Save Changes. At this time, the filing information will not be displayed at the bottom of the web page, and you need to continue with the next steps.

2. Find the side-info.php in the directory of the theme you are using, for example, I use the directory wp-content/themes/twentyseventeen/template-parts/footer/ of the main body twentyseventeen. This is the most important, because most of the previous blogs provided solutions to find home.php or index.php in the /wp-content/themes/twentyseventeen/ directory.

At this time, you will see the code of side-info.php is as follows:

<?php
/**
 * Displays footer site info
 *
 * @package WordPress
 * @subpackage Twenty_Seventeen
 * @since 1.0
 * @version 1.0
 */

?>
<div class="site-info">
    <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyseventeen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyseventeen' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->

Add filing information after the last a tag under the <div class=”site-info”> tag. The modified side-info.php is as follows:

<?php
/**
 * Displays footer site info
 *
 * @package WordPress
 * @subpackage Twenty_Seventeen
 * @since 1.0
 * @version 1.0
 */

?>
<div class="site-info">
    <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyseventeen' ) ); ?>">
        <?php printf( __( 'Proudly powered by %s', 'twentyseventeen' ), 'WordPress' ); ?>
  </a>
  |
 <span><a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank"><?php echo get_option( 'zh_cn_l10n_icp_num' );?></a></span>  
</div><!-- .site-info -->

The function that outputs the filing information is:

<?php echo get_option( 'zh_cn_l10n_icp_num' );?>

This function will obtain the record number set in the background in the first step, and output it to the page through the echo function.
write picture description here
References:

  1. How to hang a record number in WordPress
  2. Let the theme display the ICP record number added in the WordPress background
  3. WordPress 4.9.1 Correct posture for adding record number

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325987761&siteId=291194637