Footer Copyright section of the WordPress site

 Footer Copyright section of the WordPress site

By showing the Footer Copyright section of the site  , it means that you will show a text box in the footer section at the bottom and write text in it, for example all rights reserved, the work will be by adding a text section in the WordPress customization section, i.e. in the  WordPress Customizer  ,

Now go to the customizer.php file that we created in previous lessons and paste the following code:

The first step :

The code he likes to put into the customizer.php file is as follows:

function studyshoot_footer_options($wp_customize){
  $wp_customize->add_section('studyshoot_footer_section' ,
                array(
                            'priority'    => '1',
                            'title'=> __( 'تذييل الموقع', 'studyshoot' ),
                             ));
   $wp_customize->add_setting('studyshoot_footer_copy_settings' ,
                    array(
                        'default'=>'جميع الحقوق محفوظة لموقع ستودي شوت للعام 2020',
                        'transport'=>'refresh',
                        'sanitize_callback' => 'wp_filter_nohtml_kses',
                        ));
                $wp_customize->add_control(new Wp_Customize_Control (
                $wp_customize,'studyshoot_footer_copy_control', 
                    array(
                        'label'=>  esc_html__( 'قسم حقوق الموقع','studyshoot' ),
                        'section' => 'studyshoot_footer_section',
                        'settings'=>'studyshoot_footer_copy_settings',
                        'type'=>'textarea'
                        )));
}
add_action( 'customize_register','studyshoot_footer_options' );

As we noticed, we created the add_settings section and then add_control as we learned  earlier  . Now if you go to the Personalization section and take a look, you will find a new section entitled | site footer | Inside it you will find a text field, you can type whatever you want with it

The second step :

Activate the code that we wrote earlier so that the copyright section appears in the footer of the site, and here we will use the following code that we will paste in the footer.php file…. See the section on creating a site footer file  from here

Paste the code where you want to show it in the footer of the site. And I will write the code with the formatting so that the text we wrote is shown at the bottom of the footer area…

<div id="footer-copy">
    <center> 
        <?php echo wpautop(get_theme_mod('studyshoot_footer_copy_settings') )?>   
    </center>
</div>

Now go to your site and take a look. Did you see the copyright section in the footer of the site I wrote in the personalization section.?

Was the lesson difficult? No… it’s ok, you just have to practice the code and play with the content format to make the section you create more effective..