Editing WordPress Site Footer

 Editing WordPress Site Footer

In many sites, you will find at the bottom of the copy rights CopyRight, or it may also mention the name of the person who designed the site, or the owner of the site itself. In addition to adding copyrights with the annual date if you wish.

Creating and Editing a Footer for a WordPress Site Using a Plugin

The Elementor Pro plugin enables you to create a website footer template. This is an excellent thing so that if you do not know how to create or deal with php codes and others, the matter here will become easier for you.

We will now learn about two ways using the Elementor extension, which is a free method and the second is paid

in case

Create and edit the footer for your WordPress site the free way

Here you must now install two plugins, the first is Elementor and the second is called Header and Footer for Elementor

Watch the following video and follow the stepsThe video explains creating and modifying the footer for a WordPress site in a free way

In case you do not like to watch the video: follow the following steps

  • Install the Elementor plugin
  • Install Header and Footer plugin
  • Go to the Appearance option in the WordPress dashboard
  • Click on Header and Footer
  • Create a new form.
  • In the Type of Template section, click on Entire site
  • Click to publish
  • Click on Editing by Elementor
  • Design the look you want for the footer of your wordpress site
  • Click Save
  • I finish

Create and edit the footer for a WordPress site in the paid way

Here you need to buy the Elementor Pro add-on, from here you can buy the add-on now and thus support me.. After installing the free and paid Elementor add-on together, activate the license and then follow the steps in the following video:The video explains the creation and modification of the footer for a WordPress site in the paid way

If you do not like to watch the video, follow the following steps

  • Install add element
  • The act of the license
  • Go to the Templates section
  • Create a new form
  • From the form creation properties, select Footer
  • Click Create
  • Design the form as you like
  • Now click on save
  • On the screen option in front of you, choose Entire site
  • I finish

Create and edit the footer for a wordpress site without a plugin

Now, here you need to modify the footer.php file .. as well as put a code in it in addition to placing a second code in the functions.php . file

Go to the appearance option, then click on the theme editor section, and search for the functions.php . file

In this file and at the bottom, if there is a ?> sign in the last line, open a new line immediately before this sign and paste the following code, and if you don’t, paste the code in the last line:

function wpmrj3_get_footer_text( $args = array() ) {

    global $wpdb;

    $defaults = array(
        'first_year'      => get_transient( 'wpmrj3_get_first_year' ),
        'current_year'    => date( 'Y' ),
        'symbol'          => '©',
        'text'            => esc_html__( 'جميع الحقوق محفوظة ', 'wpmrj3' ),//add your text here
        'site_name'       => get_bloginfo( 'name' ),
        'text_separator'  => ' **  ',// Change the * Sympole as you need
        'years_separator' => '-', // Change the - Sympole as you need
    );

    extract( apply_filters( 'wpmrj3_footer_credits_args', wp_parse_args( (array) $args, $defaults ) ) );
    unset( $args );

    if ( false === $first_year ) {

        $sql = "SELECT YEAR(min(post_date_gmt))
                AS first_year
                FROM $wpdb->posts
                WHERE post_status = 'publish'";

        if ( false === $first_year ) {
            $post_date_gmt = $wpdb->get_results( $sql ); // WPCS: cache ok. db call ok. unprepared SQL OK.

            if ( is_array( $post_date_gmt ) ) {
                set_transient( 'wpmrj3_get_first_year', $post_date_gmt[0]->first_year, MONTH_IN_SECONDS );
                unset( $post_date_gmt );
            }
        }
    }

    $output = $text . $text_separator . $site_name . ' ' . $symbol . ' ';

    if ( $current_year !== $first_year ) {

        $years = $first_year . $years_separator . $current_year;

        $output .= $years;
    } else {
        $output .= $current_year;
    }

    return apply_filters( 'wpmrj3_footer_text', $output );
}

Put the code in the file footer.php

  • In this file you should look for a function < ?php wp_footer () ; ? > .. If this function is at the bottom of the file and there is nothing after it, then write the following code immediately before it
  • But if the function is at the beginning of the file, delete everything below it and also put the following code
  • Watch out | The closing tags < / /body >< /html > should also be directly below the function..

The code you can use is:

<?php echo esc_html( wpmrj3_get_footer_text() ) ?>