Friday, April 21, 2023

Create extra fields in page or post or custom post type

Hello.

Today I saw you how to add some extra fields in your post, page or custom post type. 

For example, you have to create social media links like facebook, instagram, twitter for consultant. 

Here I created 4 fields. I used consultant post type, which is my custom post type. You can use page or post also.

You have to put this code:

//new metabox for consultant type
function wporg_add_custom_box() {
    $screens = [ 'consultant', 'wporg_cpt' ];
    foreach ( $screens as $screen ) {
        add_meta_box(
            'wporg_box_id',                 // Unique ID
            'Social Media Links Here',      // Box title
            'wporg_custom_box_html',  // Content callback, must be of type callable
            $screen                            // Post type
        );
    }
}
add_action( 'add_meta_boxes', 'wporg_add_custom_box' );
function wporg_custom_box_html( $post ) {
    $fblink = get_post_meta( $post->ID, 'metakey_facebook', true );
    $instalink = get_post_meta( $post->ID, 'metakey_insta', true );
    $twitterlink = get_post_meta( $post->ID, 'metakey_twitter', true );
    $pinrestlink = get_post_meta( $post->ID, 'metakey_pinrest', true );
    ?>
    <p> <label for="facebooklink">Facebook</label>
    <input type="text" name="facebooklink" id="facebooklink" value="<?php echo $fblink; ?>"></p>
    <p><label for="instalink">Instagram</label>
    <input type="text" name="instalink" id="instalink" value="<?php echo $instalink; ?>"></p>
    <p> <label for="twitterlink">Twitter</label>
    <input type="text" name="twitterlink" id="twitterlink" value="<?php echo $twitterlink; ?>"></p>
    <p><label for="pinrestlink">Pinrest</label>
    <input type="text" name="pinrestlink" id="pinrestlink" value="<?php echo $pinrestlink; ?>"></p>
    <?php
}
function wporg_save_postdata( $post_id ) {
    if ( array_key_exists( 'facebooklink', $_POST ) ) {
        update_post_meta(
            $post_id,
            'metakey_facebook',
            $_POST['facebooklink']
        );
    }
    if ( array_key_exists( 'instalink', $_POST ) ) {
        update_post_meta(
            $post_id,
            'metakey_insta',
            $_POST['instalink']
        );
    }
    if ( array_key_exists( 'twitterlink', $_POST ) ) {
        update_post_meta(
            $post_id,
            'metakey_twitter',
            $_POST['twitterlink']
        );
    }
    if ( array_key_exists( 'pinrestlink', $_POST ) ) {
        update_post_meta(
            $post_id,
            'metakey_pinrest',
            $_POST['pinrestlink']
        );
    }
}
add_action( 'save_post', 'wporg_save_postdata' );
//end consultant code


In this code you have to change "consultant" to "post" or "page" or any of your custom post type slug.

You have to change in this : $screens = [ 'consultant', 'wporg_cpt' ];



Create custom post type in wordpress with code and without plugin

Hello Today I am going to explain how to create custom post type in any wordpress theme. No need for plugin. Simply copy paste this code in your current theme->functions.php file.


functions.php

//custom post type for Consultant details
function consultatns_custom() {
  
// Set UI labels for Custom Post Type
    $labels = array(
        'name'                => _x( 'Consultant', 'Post Type General Name', 'trek' ),
        'singular_name'       => _x( 'consultant', 'Post Type Singular Name', 'trek' ),
        'menu_name'           => __( 'Consultant', 'trek' ),
        'parent_item_colon'   => __( 'Parent Consultant', 'trek' ),
        'all_items'           => __( 'All Consultants', 'trek' ),
        'view_item'           => __( 'View consultant', 'trek' ),
        'add_new_item'        => __( 'Add New consultant', 'trek' ),
        'add_new'             => __( 'Add New', 'trek' ),
        'edit_item'           => __( 'Edit consultant', 'trek' ),
        'update_item'         => __( 'Update consultant', 'trek' ),
        'search_items'        => __( 'Search consultant', 'trek' ),
        'not_found'           => __( 'Not Found', 'trek' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'trek' ),
    );
      
// Set other options for Custom Post Type
      
    $args = array(
        'label'               => __( 'consultant', 'trek' ),
        'description'         => __( 'All Consultant data', 'trek' ),
        'labels'              => $labels,
        // Features this CPT supports in Post Editor
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields' ),
        // You can associate this CPT with a taxonomy or custom taxonomy. 
        //'taxonomies'          => array( 'genres' ),
        /* A hierarchical CPT is like Pages and can have
        * Parent and child items. A non-hierarchical CPT
        * is like Posts.
        */
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
        'show_in_rest' => true,
        
        'taxonomies'          => array( 'category' ),
    );
      
    // Registering your Custom Post Type
    register_post_type( 'consultant', $args );
  
}
  
/* Hook into the 'init' action so that the function
* Containing our post type registration is not 
* unnecessarily executed. 
*/
  
add_action( 'init', 'consultatns_custom', 5 );



Wednesday, April 19, 2023

Create custom wordpress theme for any website or html template in very easy way

Hello

Today I saw you how to create custom wordpress theme.

If you want to make theme from any template, please download it to your local and test html is working fine or not.

If you want to make from any website, please save as to your local, arrange files like css, js, images in assets folder. make sure that this downloaded html page is working okay in offline mode.


You have to create theme folder in wp-content -> themes folder. For example I make a folder named "Myloan".

Create these files first in your theme folder "Myloan":-

  1. style.css
  2. functions.php
  3. header.php
  4. footer.php
  5. page.php
  6. index.php
  7. screenshot.png
  8. assets(folder which contains all files like css, js, images)


Put simple code like this:- must write this code

style.css

/*

Theme Name: My Loan

Theme URI: #

Author: Chirag

Author URI: https://wordpress.org/

Description: #

Tested up to: 6.2

Requires PHP: 5.6

Version: 1.1

License: GNU General Public License v2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Text Domain: myloan

Tags: one-column, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready

*/


functions.php: include css js and other code:

<?php

/**

 * @package WordPress

 * @subpackage myloan

 * @version 1.1

 * 

 * Main Theme Functions File

 * Created by CMSMasters

 * 

 */



/*** START EDIT THEME PARAMETERS HERE ***/


function load_stylesheets(){

    wp_register_style('css1',get_template_directory_uri().'/assets/css.css',array(),'1','all');

    wp_enqueue_style('css1');

    wp_register_style('css2',get_template_directory_uri().'/assets/autoptimize_8cac1e736864bdc86b06e5465ca5d637.css',array(),'1','all');

    wp_enqueue_style('css2');

    wp_register_style('css3',get_template_directory_uri().'/assets/autoptimize_single_67cf90d667118914b7946e19b3d520ab.css',array(),'1','all');

    wp_enqueue_style('css3');

    wp_register_style('css4',get_template_directory_uri().'/assets/autoptimize_single_8eaf06f89938b4c3f43d5ada62c34f11.css',array(),'1','all');

    wp_enqueue_style('css4');

    wp_register_style('css5',get_template_directory_uri().'/assets/autoptimize_single_4f790d313876572982c13e7b9457038c.css',array(),'1','all');

    wp_enqueue_style('css5');

    wp_register_style('css6',get_template_directory_uri().'/assets/autoptimize_single_82d56e6b6d66f13ec624b1f11d32043c.css',array(),'1','all');

    wp_enqueue_style('css6');

    wp_register_style('css7',get_template_directory_uri().'/assets/autoptimize_single_0b5653b6da6b0767bb25989aa360979d.css',array(),'1','all');

    wp_enqueue_style('css7');

    wp_register_style('customcss',get_template_directory_uri().'/assets/customcss.css',array(),'1','all');

    wp_enqueue_style('customcss');

}

add_action('wp_enqueue_scripts','load_stylesheets');


function addjs(){

    //header scripts

    wp_register_script('jquery',get_template_directory_uri().'/assets/jquery.min.js', '', 1,1,1);

    wp_enqueue_script('jquery');

    wp_register_script('jquery-migrate',get_template_directory_uri().'/assets/jquery-migrate.min.js', '', 1,1,1);

    wp_enqueue_script('jquery-migrate');

    wp_register_script('autoptimize1',get_template_directory_uri().'/assets/autoptimize_single_4ce62d8207dae4259cb82c779adc78d5.js', '', 1,1,1);

    wp_enqueue_script('autoptimize1');

    wp_register_script('shims',get_template_directory_uri().'/assets/v4-shims.min.js', '', 1,1,1);

    wp_enqueue_script('shims');

    wp_register_script('modernizr-custom',get_template_directory_uri().'/assets/modernizr-custom.min.js', '', 1,1,1);

    wp_enqueue_script('modernizr-custom');

    wp_register_script('jquery2',get_template_directory_uri().'/assets/5e3b1d77-f013-4473-86af-e78be1a3f8b8.js', '', 1,1,1);

    wp_enqueue_script('jquery2');

    

    wp_register_script('jsjs',get_template_directory_uri().'/assets/js.js', '', 1,1,1);

    wp_enqueue_script('jsjs');


    //footer scripts

    wp_register_script('imagesloaded-js',get_template_directory_uri().'/assets/imagesloaded.min.js', '', 1,1,1);

    wp_enqueue_script('imagesloaded-js');

    wp_register_script('masonry-js',get_template_directory_uri().'/assets/masonry.min.js', '', 1,1,1);

    wp_enqueue_script('masonry-js');

    wp_register_script('auxin-plugins-js',get_template_directory_uri().'/assets/plugins.min.js', '', 1,1,1);

    wp_enqueue_script('auxin-plugins-js');

    wp_register_script('auxin-scripts-js',get_template_directory_uri().'/assets/scripts.min.js', '', 1,1,1);

    wp_enqueue_script('auxin-scripts-js');

    wp_register_script('auxin-elementor-widgets-js',get_template_directory_uri().'/assets/autoptimize_single_b7ce792f0d03f8d9e4330abe54cbb741.js', '', 1,1,1);

    wp_enqueue_script('auxin-elementor-widgets-js');

    wp_register_script('mediaelement-core-js',get_template_directory_uri().'/assets/mediaelement-and-player.min.js', '', 1,1,1);

    wp_enqueue_script('mediaelement-core-js');

    wp_register_script('mediaelement-migrate-js',get_template_directory_uri().'/assets/mediaelement-migrate.min.js', '', 1,1,1);

    wp_enqueue_script('mediaelement-migrate-js');

    wp_register_script('wp-mediaelement-js',get_template_directory_uri().'/assets/wp-mediaelement.min.js', '', 1,1,1);

    wp_enqueue_script('wp-mediaelement-js');

    wp_register_script('auxin-elements-plugins-js',get_template_directory_uri().'/assets/plugins.min(1).js', '', 1,1,1);

    wp_enqueue_script('auxin-elements-plugins-js');

    wp_register_script('auxin-elements-scripts-js',get_template_directory_uri().'/assets/autoptimize_single_666ddb314d62d4d200ca34b8f15c72c5.js', '', 1,1,1);

    wp_enqueue_script('auxin-elements-scripts-js');

    wp_register_script('auxin-portfolio-portfolio-js',get_template_directory_uri().'/assets/autoptimize_single_7e48ff2a3e322642d873f3e82dbd0ed1.js', '', 1,1,1);

    wp_enqueue_script('auxin-portfolio-portfolio-js');

    wp_register_script('jquery-numerator-js',get_template_directory_uri().'/assets/jquery-numerator.min.js', '', 1,1,1);

    wp_enqueue_script('jquery-numerator-js');

    wp_register_script('auxin-pro-tools-pro-js',get_template_directory_uri().'/assets/autoptimize_single_55abb9814ae416a1f10acdb0e34f71aa.js', '', 1,1,1);

    wp_enqueue_script('auxin-pro-tools-pro-js');

    wp_register_script('auxin-custom-js-js',get_template_directory_uri().'/assets/custom.js', '', 1,1,1);

    wp_enqueue_script('auxin-custom-js-js');

    wp_register_script('smartmenus-js',get_template_directory_uri().'/assets/jquery.smartmenus.min.js', '', 1,1,1);

    wp_enqueue_script('smartmenus-js');

    wp_register_script('elementor-pro-webpack-runtime-js',get_template_directory_uri().'/assets/webpack-pro.runtime.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-pro-webpack-runtime-js');

    wp_register_script('elementor-webpack-runtime-js',get_template_directory_uri().'/assets/webpack.runtime.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-webpack-runtime-js');

    wp_register_script('elementor-frontend-modules-js',get_template_directory_uri().'/assets/frontend-modules.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-frontend-modules-js');

    wp_register_script('wp-polyfill-inert-js',get_template_directory_uri().'/assets/wp-polyfill-inert.min.js', '', 1,1,1);

    wp_enqueue_script('wp-polyfill-inert-js');

    wp_register_script('regenerator-runtime-js',get_template_directory_uri().'/assets/regenerator-runtime.min.js', '', 1,1,1);

    wp_enqueue_script('regenerator-runtime-js');

    wp_register_script('wp-polyfill-js',get_template_directory_uri().'/assets/wp-polyfill.min.js', '', 1,1,1);

    wp_enqueue_script('wp-polyfill-js');

    wp_register_script('wp-hooks-js',get_template_directory_uri().'/assets/hooks.min.js', '', 1,1,1);

    wp_enqueue_script('wp-hooks-js');

    wp_register_script('wp-i18n-js',get_template_directory_uri().'/assets/i18n.min.js', '', 1,1,1);

    wp_enqueue_script('wp-i18n-js');

    wp_register_script('elementor-pro-frontend-js',get_template_directory_uri().'/assets/frontend.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-pro-frontend-js');

    wp_register_script('elementor-waypoints-js',get_template_directory_uri().'/assets/waypoints.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-waypoints-js');

    wp_register_script('jquery-ui-core-js',get_template_directory_uri().'/assets/core.min.js', '', 1,1,1);

    wp_enqueue_script('jquery-ui-core-js');

    wp_register_script('swiper-js',get_template_directory_uri().'/assets/swiper.min.js', '', 1,1,1);

    wp_enqueue_script('swiper-js');

    wp_register_script('share-link-js',get_template_directory_uri().'/assets/share-link.min.js', '', 1,1,1);

    wp_enqueue_script('share-link-js');

    wp_register_script('elementor-dialog-js',get_template_directory_uri().'/assets/dialog.min.js', '', 1,1,1);

    wp_enqueue_script('elementor-dialog-js');

    wp_register_script('elementor-frontend-js',get_template_directory_uri().'/assets/frontend.min(1).js', '', 1,1,1);

    wp_enqueue_script('elementor-frontend-js');

    wp_register_script('pro-preloaded-elements-handlers-js',get_template_directory_uri().'/assets/preloaded-elements-handlers.min.js', '', 1,1,1);

    wp_enqueue_script('pro-preloaded-elements-handlers-js');

    wp_register_script('preloaded-modules-js',get_template_directory_uri().'/assets/preloaded-modules.min.js', '', 1,1,1);

    wp_enqueue_script('preloaded-modules-js');

    wp_register_script('e-sticky-js',get_template_directory_uri().'/assets/jquery.sticky.min.js', '', 1,1,1);

    wp_enqueue_script('e-sticky-js');

}

add_action( 'wp_enqueue_scripts', 'addjs' );


//acf page

//acf option page

if( function_exists('acf_add_options_page') ) {

    acf_add_options_page(array(

        'page_title'    => 'Theme General Settings',

        'menu_title'    => 'Theme Settings',

        'menu_slug'     => 'theme-general-settings',

        'capability'    => 'edit_posts',

        'redirect'      => false

    ));

    

    acf_add_options_sub_page(array(

        'page_title'    => 'Theme Header Settings',

        'menu_title'    => 'Header',

        'parent_slug'   => 'theme-general-settings',

    ));

    

    acf_add_options_sub_page(array(

        'page_title'    => 'Theme Footer Settings',

        'menu_title'    => 'Footer',

        'parent_slug'   => 'theme-general-settings',

    ));

}

//end option page

//end



header.php : must write <?php wp_head(); ?> before </head>

<?php

/**

 * The header.

 *

 * This is the template that displays all of the <head> section and everything up until main.

 *

 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials

 * 

 */


?>

<!DOCTYPE html>

<!-- saved from url=(0027)https://www.mydomainname.com/ -->

<html class="js audio canvas fullscreen svg video cssanimations boxshadow csscolumns csscolumns-width csscolumns-span csscolumns-fill csscolumns-gap csscolumns-rule csscolumns-rulecolor csscolumns-rulestyle csscolumns-rulewidth csscolumns-breakbefore csscolumns-breakafter csscolumns-breakinside flexbox csscalc no-flexboxtweener cssgradients csstransforms supports csstransforms3d csstransitions objectfit object-fit cssclippathsvg cssclippathinset cssclippathcircle cssclippathellipse cssclippathpolygon" lang="en-US">

   <!--<![endif]-->

   <head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

      <meta http-equiv="X-UA-Compatible" content="IE=edge">

      <meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width">

      <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">

     

      <title>MY USA LOANS | Get Cash When You Need It | PAYDAY LOANS ONLINE</title>

      <meta name="description" content="Get Cash When You Need It With mydomainname">

      <link rel="canonical" href="https://www.mydomainname.com/">

      <meta property="og:locale" content="en_US">

      <meta property="og:type" content="website">

      <meta property="og:title" content="Home">

      <meta property="og:description" content="Get Cash When You Need It With mydomainname">

      <meta property="og:url" content="https://www.mydomainname.com/">

      <meta property="og:site_name" content="MY USA LOANS">

      <meta property="article:modified_time" content="2023-02-16T01:58:40+00:00">

      <meta property="og:image" content="https://www.mydomainname.com/wp-content/uploads/2021/03/Group-33.svg">

      <meta name="twitter:card" content="summary_large_image">

       

      <meta name="google-site-verification" content="-e_j1rqcdotBIlghURcuh87xno__ggo-3DdsQLOvInE">

      <link href="https://fonts.gstatic.com/" crossorigin="anonymous" rel="preconnect">

      <link rel="alternate" type="application/rss+xml" title="MY USA LOANS » Feed" href="https://www.mydomainname.com/feed/">

      <link rel="alternate" type="application/rss+xml" title="MY USA LOANS » Comments Feed" href="https://www.mydomainname.com/comments/feed/">

      <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin="">

      <link rel="https://api.w.org/" href="https://www.mydomainname.com/wp-json/">

      <link rel="alternate" type="application/json" href="https://www.mydomainname.com/wp-json/wp/v2/pages/7266">

      <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.mydomainname.com/xmlrpc.php?rsd">

      <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.mydomainname.com/wp-includes/wlwmanifest.xml">

      <meta name="generator" content="WordPress 6.2">

      <link rel="shortlink" href="https://www.mydomainname.com/">

      <link rel="alternate" type="application/json+oembed" href="https://www.mydomainname.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.mydomainname.com%2F">

      <link rel="alternate" type="text/xml+oembed" href="https://www.mydomainname.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.mydomainname.com%2F&amp;format=xml"> 

      <meta name="theme-color" content="#1bb0ce">

      <meta name="msapplication-navbutton-color" content="#1bb0ce">

      <meta name="apple-mobile-web-app-capable" content="yes">

      <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

      <meta name="generator" content="Elementor 3.12.1; features: a11y_improvements, additional_custom_breakpoints; settings: css_print_method-external, google_font-enabled, font_display-auto">

      <link rel="icon" href="https://www.mydomainname.com/wp-content/uploads/2022/06/cropped-mul-favicon-32x32.png" sizes="32x32">

      <link rel="icon" href="https://www.mydomainname.com/wp-content/uploads/2022/06/cropped-mul-favicon-192x192.png" sizes="192x192">

      <link rel="apple-touch-icon" href="https://www.mydomainname.com/wp-content/uploads/2022/06/cropped-mul-favicon-180x180.png">

      <meta name="msapplication-TileImage" content="https://www.mydomainname.com/wp-content/uploads/2022/06/cropped-mul-favicon-270x270.png">

      <style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>

     

      <?php wp_head(); ?>

   </head>

   <body class="home page-template page-template-elementor_header_footer page page-id-7266 wp-custom-logo auxin-pro elementor-default elementor-template-full-width elementor-kit-7232 elementor-page elementor-page-7266 phlox-pro aux-full-width aux-resp aux-s-fhd aux-page-animation-off _auxels aux-dom-ready e--ua-blink e--ua-chrome e--ua-webkit" data-framed="" data-elementor-device-mode="desktop" cz-shortcut-listen="true">

      <div id="inner-body">

         <div data-elementor-type="header" data-elementor-id="7265" class="elementor elementor-7265 elementor-location-header">

            <div class="elementor-section-wrap">

               <section class="elementor-section elementor-top-section elementor-element elementor-element-b5ac306 aux-header elementor-section-content-middle elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="b5ac306" data-element_type="section" data-settings="{&quot;background_background&quot;:&quot;classic&quot;,&quot;animation&quot;:&quot;none&quot;}">

                  <div class="elementor-container elementor-column-gap-default">

                     <div class="elementor-row">

                        <div class="aux-parallax-section elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-861ddb7" data-id="861ddb7" data-element_type="column" data-settings="{&quot;background_background&quot;:&quot;classic&quot;,&quot;animation&quot;:&quot;none&quot;}">

                           <div class="elementor-column-wrap elementor-element-populated">

                              <div class="elementor-background-overlay"></div>

                              <div class="elementor-widget-wrap">

                                 <section class="elementor-section elementor-inner-section elementor-element elementor-element-b841b11 elementor-section-content-middle elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="b841b11" data-element_type="section" data-settings="{&quot;background_background&quot;:&quot;classic&quot;,&quot;animation&quot;:&quot;none&quot;}">

                                    <div class="elementor-container elementor-column-gap-default">

                                       <div class="elementor-row">

                                          <div class="aux-parallax-section elementor-column elementor-col-33 elementor-inner-column elementor-element elementor-element-1c98f42" data-id="1c98f42" data-element_type="column">

                                             <div class="elementor-column-wrap elementor-element-populated">

                                                <div class="elementor-widget-wrap">

                                                   <div class="elementor-element elementor-element-c040b48 elementor-widget elementor-widget-aux_logo" data-id="c040b48" data-element_type="widget" data-widget_type="aux_logo.default">

                                                      <div class="elementor-widget-container">

                                                         <div class="aux-widget-logo">

                                                            <a class="aux-logo-anchor aux-has-logo" title="MY USA LOANS" href="https://www.mydomainname.com/"><img width="260" height="152" src="<?php bloginfo('template_directory'); ?>/assets/mul-logo-dk-blue-2.png" class="aux-attachment aux-featured-image attachment-260x152 aux-attachment-id-10907 " alt="mul-logo-dk-blue-2" data-ratio="1.71" data-original-w="260"></a>

                                                            <section class="aux-logo-text">

                                                               <h3 class="site-title"><a href="https://www.mydomainname.com/" title="MY USA LOANS">MY USA LOANS</a></h3>

                                                               <p class="site-description">PAYDAY LOANS ONLINE</p>

                                                            </section>

                                                         </div>

                                                      </div>

                                                   </div>

                                                </div>

                                             </div>

                                          </div>

                                          <div class="aux-parallax-section elementor-column elementor-col-33 elementor-inner-column elementor-element elementor-element-a345ae0" data-id="a345ae0" data-element_type="column" data-settings="{&quot;animation&quot;:&quot;none&quot;}">

                                             <div class="elementor-column-wrap elementor-element-populated">

                                                <div class="elementor-widget-wrap">

                                                   <div class="elementor-element elementor-element-d472bf1 elementor-nav-menu__align-right elementor-hidden-tablet elementor-hidden-phone elementor-nav-menu--dropdown-tablet elementor-nav-menu__text-align-aside elementor-nav-menu--toggle elementor-nav-menu--burger elementor-widget elementor-widget-nav-menu" data-id="d472bf1" data-element_type="widget" data-settings="{&quot;submenu_icon&quot;:{&quot;value&quot;:&quot;&lt;i class=\&quot;fas fa-chevron-down\&quot;&gt;&lt;\/i&gt;&quot;,&quot;library&quot;:&quot;fa-solid&quot;},&quot;layout&quot;:&quot;horizontal&quot;,&quot;toggle&quot;:&quot;burger&quot;}" data-widget_type="nav-menu.default">

                                                      <div class="elementor-widget-container">

                                                         <nav class="elementor-nav-menu--main elementor-nav-menu__container elementor-nav-menu--layout-horizontal e--pointer-none">

                                                            <ul id="menu-1-d472bf1" class="elementor-nav-menu" data-smartmenus-id="16817547812465557">

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-7266 current_page_item menu-item-8457"><a href="https://www.mydomainname.com/" aria-current="page" class="elementor-item elementor-item-active">Home</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8461"><a href="https://www.mydomainname.com/how-it-works/" class="elementor-item">How It Works</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-6500">

                                                                  <a class="elementor-item has-submenu" id="sm-16817547812465557-1" aria-haspopup="true" aria-controls="sm-16817547812465557-2" aria-expanded="false">Our Products<span class="sub-arrow"><i class="fas fa-chevron-down"></i></span></a>

                                                                  <ul class="sub-menu elementor-nav-menu--dropdown" id="sm-16817547812465557-2" role="group" aria-hidden="true" aria-labelledby="sm-16817547812465557-1" aria-expanded="false">

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8459"><a href="https://www.mydomainname.com/short-term-loans-bad-credit/" class="elementor-sub-item">Bad Credit Loans</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8463"><a href="https://www.mydomainname.com/loans-by-state/payday-loans-online/" class="elementor-sub-item">Payday Loans Online</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8462"><a href="https://www.mydomainname.com/online-loans/" class="elementor-sub-item">Online Loans</a></li>

                                                                  </ul>

                                                               </li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8465"><a href="https://www.mydomainname.com/rates-fees/" class="elementor-item">Rates &amp; Fees</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8460"><a href="https://www.mydomainname.com/contact/" class="elementor-item">Contact</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8458"><a href="https://www.mydomainname.com/blog/" class="elementor-item">Blog</a></li>

                                                            </ul>

                                                         </nav>

                                                         <div class="elementor-menu-toggle" role="button" tabindex="0" aria-label="Menu Toggle" aria-expanded="false"> <i aria-hidden="true" role="presentation" class="elementor-menu-toggle__icon--open eicon-menu-bar"></i><i aria-hidden="true" role="presentation" class="elementor-menu-toggle__icon--close eicon-close"></i> <span class="elementor-screen-only">Menu</span></div>

                                                         <nav class="elementor-nav-menu--dropdown elementor-nav-menu__container" aria-hidden="true">

                                                            <ul id="menu-2-d472bf1" class="elementor-nav-menu" data-smartmenus-id="168175478125283">

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-7266 current_page_item menu-item-8457"><a href="https://www.mydomainname.com/" aria-current="page" class="elementor-item elementor-item-active" tabindex="-1">Home</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8461"><a href="https://www.mydomainname.com/how-it-works/" class="elementor-item" tabindex="-1">How It Works</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-6500">

                                                                  <a class="elementor-item has-submenu" tabindex="-1" id="sm-168175478125283-1" aria-haspopup="true" aria-controls="sm-168175478125283-2" aria-expanded="false">Our Products<span class="sub-arrow"><i class="fas fa-chevron-down"></i></span></a>

                                                                  <ul class="sub-menu elementor-nav-menu--dropdown" id="sm-168175478125283-2" role="group" aria-hidden="true" aria-labelledby="sm-168175478125283-1" aria-expanded="false">

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8459"><a href="https://www.mydomainname.com/short-term-loans-bad-credit/" class="elementor-sub-item" tabindex="-1">Bad Credit Loans</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8463"><a href="https://www.mydomainname.com/loans-by-state/payday-loans-online/" class="elementor-sub-item" tabindex="-1">Payday Loans Online</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8462"><a href="https://www.mydomainname.com/online-loans/" class="elementor-sub-item" tabindex="-1">Online Loans</a></li>

                                                                  </ul>

                                                               </li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8465"><a href="https://www.mydomainname.com/rates-fees/" class="elementor-item" tabindex="-1">Rates &amp; Fees</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8460"><a href="https://www.mydomainname.com/contact/" class="elementor-item" tabindex="-1">Contact</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8458"><a href="https://www.mydomainname.com/blog/" class="elementor-item" tabindex="-1">Blog</a></li>

                                                            </ul>

                                                         </nav>

                                                      </div>

                                                   </div>

                                                   <div class="elementor-element elementor-element-191934f elementor-nav-menu__align-right elementor-hidden-desktop elementor-nav-menu--dropdown-tablet elementor-nav-menu__text-align-aside elementor-nav-menu--toggle elementor-nav-menu--burger elementor-widget elementor-widget-nav-menu" data-id="191934f" data-element_type="widget" data-settings="{&quot;submenu_icon&quot;:{&quot;value&quot;:&quot;&lt;i class=\&quot;fas fa-chevron-down\&quot;&gt;&lt;\/i&gt;&quot;,&quot;library&quot;:&quot;fa-solid&quot;},&quot;layout&quot;:&quot;horizontal&quot;,&quot;toggle&quot;:&quot;burger&quot;}" data-widget_type="nav-menu.default">

                                                      <div class="elementor-widget-container">

                                                         <nav class="elementor-nav-menu--main elementor-nav-menu__container elementor-nav-menu--layout-horizontal e--pointer-none">

                                                            <ul id="menu-1-191934f" class="elementor-nav-menu" data-smartmenus-id="16817547812565857">

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-7266 current_page_item menu-item-9015"><a href="https://www.mydomainname.com/" aria-current="page" class="elementor-item elementor-item-active">Home</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9020"><a href="https://www.mydomainname.com/how-it-works/" class="elementor-item">How It Works</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-9024">

                                                                  <a href="https://www.mydomainname.com/#" class="elementor-item elementor-item-anchor has-submenu" id="sm-16817547812565857-1" aria-haspopup="true" aria-controls="sm-16817547812565857-2" aria-expanded="false">Our Products<span class="sub-arrow"><i class="fas fa-chevron-down"></i></span></a>

                                                                  <ul class="sub-menu elementor-nav-menu--dropdown" id="sm-16817547812565857-2" role="group" aria-hidden="true" aria-labelledby="sm-16817547812565857-1" aria-expanded="false">

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9016"><a href="https://www.mydomainname.com/short-term-loans-bad-credit/" class="elementor-sub-item">Bad Credit Loans</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9022"><a href="https://www.mydomainname.com/loans-by-state/payday-loans-online/" class="elementor-sub-item">Payday Loans Online</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9021"><a href="https://www.mydomainname.com/online-loans/" class="elementor-sub-item">Online Loans</a></li>

                                                                  </ul>

                                                               </li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9023"><a href="https://www.mydomainname.com/rates-fees/" class="elementor-item">Rates &amp; Fees</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9018"><a href="https://www.mydomainname.com/contact/" class="elementor-item">Contact</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9017"><a href="https://www.mydomainname.com/blog/" class="elementor-item">Blog</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10993"><a href="https://www.mydomainname.com/get-started/" class="elementor-item">Get Started</a></li>

                                                            </ul>

                                                         </nav>

                                                         <div class="elementor-menu-toggle" role="button" tabindex="0" aria-label="Menu Toggle" aria-expanded="false"> <i aria-hidden="true" role="presentation" class="elementor-menu-toggle__icon--open eicon-menu-bar"></i><i aria-hidden="true" role="presentation" class="elementor-menu-toggle__icon--close eicon-close"></i> <span class="elementor-screen-only">Menu</span></div>

                                                         <nav class="elementor-nav-menu--dropdown elementor-nav-menu__container" aria-hidden="true">

                                                            <ul id="menu-2-191934f" class="elementor-nav-menu" data-smartmenus-id="16817547812578323">

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-7266 current_page_item menu-item-9015"><a href="https://www.mydomainname.com/" aria-current="page" class="elementor-item elementor-item-active" tabindex="-1">Home</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9020"><a href="https://www.mydomainname.com/how-it-works/" class="elementor-item" tabindex="-1">How It Works</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-9024">

                                                                  <a href="https://www.mydomainname.com/#" class="elementor-item elementor-item-anchor has-submenu" tabindex="-1" id="sm-16817547812578323-1" aria-haspopup="true" aria-controls="sm-16817547812578323-2" aria-expanded="false">Our Products<span class="sub-arrow"><i class="fas fa-chevron-down"></i></span></a>

                                                                  <ul class="sub-menu elementor-nav-menu--dropdown" id="sm-16817547812578323-2" role="group" aria-hidden="true" aria-labelledby="sm-16817547812578323-1" aria-expanded="false">

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9016"><a href="https://www.mydomainname.com/short-term-loans-bad-credit/" class="elementor-sub-item" tabindex="-1">Bad Credit Loans</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9022"><a href="https://www.mydomainname.com/loans-by-state/payday-loans-online/" class="elementor-sub-item" tabindex="-1">Payday Loans Online</a></li>

                                                                     <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9021"><a href="https://www.mydomainname.com/online-loans/" class="elementor-sub-item" tabindex="-1">Online Loans</a></li>

                                                                  </ul>

                                                               </li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9023"><a href="https://www.mydomainname.com/rates-fees/" class="elementor-item" tabindex="-1">Rates &amp; Fees</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9018"><a href="https://www.mydomainname.com/contact/" class="elementor-item" tabindex="-1">Contact</a></li>

                                                               <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9017"><a href="https://www.mydomainname.com/blog/" class="elementor-item" tabindex="-1">Blog</a></li>

                                                               <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10993"><a href="https://www.mydomainname.com/get-started/" class="elementor-item" tabindex="-1">Get Started</a></li>

                                                            </ul>

                                                         </nav>

                                                      </div>

                                                   </div>

                                                </div>

                                             </div>

                                          </div>

                                          <div class="aux-parallax-section elementor-column elementor-col-33 elementor-inner-column elementor-element elementor-element-fc279d0 elementor-hidden-mobile elementor-hidden-tablet" data-id="fc279d0" data-element_type="column">

                                             <div class="elementor-column-wrap elementor-element-populated">

                                                <div class="elementor-widget-wrap">

                                                   <div class="elementor-element elementor-element-1d41229 elementor-widget elementor-widget-aux_button" data-id="1d41229" data-element_type="widget" data-widget_type="aux_button.default">

                                                      <div class="elementor-widget-container"> <a href="https://www.mydomainname.com/get-started/" target="_self" class="aux-button aux-small aux-black aux-curve aux-none aux-uppercase"><span class="aux-overlay"></span><span class="aux-text">Get Started</span></a></div>

                                                   </div>

                                                </div>

                                             </div>

                                          </div>

                                       </div>

                                    </div>

                                 </section>

                              </div>

                           </div>

                        </div>

                     </div>

                  </div>

               </section>

            </div>

         </div>



footer.php: must write <?php wp_footer(); ?> before </body>

__________________

---------------------------

<?php wp_footer(); ?>

   </body>

</html>


index.php: must write get_header(); and get_footer(); to this page.

<?php

/**

 * The main template file

 *

 * This is the most generic template file in a WordPress theme

 * and one of the two required files for a theme (the other being style.css).

 * It is used to display a page when nothing more specific matches a query.

 * E.g., it puts together the home page when no home.php file exists.

 */


get_header(); ?>

<?php if ( is_home() && ! is_front_page() && ! empty( single_post_title( '', false ) ) ) : ?>

<header class="page-header alignwide">

<h1 class="page-title"><?php single_post_title(); ?></h1>

</header><!-- .page-header -->

<?php endif; ?>

<?php

if ( have_posts() ) {

// Load posts loop.

while ( have_posts() ) {

the_post();

//get_template_part( 'template-parts/content/content', get_theme_mod( 'display_excerpt_or_full_post', 'excerpt' ) );

}

// Previous/next page navigation.

//twenty_twenty_one_the_posts_navigation();

} else {

// If no content, include the "No posts found" template.

//get_template_part( 'template-parts/content/content-none' );


}

get_footer();

Create footer option with acf in wordpress admin panel

Hello
Today I explain how to create footer option in admin side with ACF (Advance Custom Fields) Plugin. Its easy to use.

1 : Open your theme's functions.php file and insert this code

//acf option page
if( function_exists('acf_add_options_page') ) {

    acf_add_options_page(array(
        'page_title'    => 'Theme General Settings',
        'menu_title'    => 'Theme Settings',
        'menu_slug'     => 'theme-general-settings',
        'capability'    => 'edit_posts',
        'redirect'      => false
    ));
    
    acf_add_options_sub_page(array(
        'page_title'    => 'Theme Header Settings',
        'menu_title'    => 'Header',
        'parent_slug'   => 'theme-general-settings',
    ));
    
    acf_add_options_sub_page(array(
        'page_title'    => 'Theme Footer Settings',
        'menu_title'    => 'Footer',
        'parent_slug'   => 'theme-general-settings',
    ));
    
}
//end option page

Now save it and refresh your admin panel. You can see this type of option.


2: Go to Custom fields option and create footer option like this: Set option like this:



save it. And create custom fields like copyright text. slug is : copyright_text
3:  Go to Dashboard-> Theme Settings -> Footer
You will find this 

save it
4: this is for footer. So open your footer.php file and put code like this.

 <?php if(!empty(get_field('copyright_text','option'))) :?>
         <p><?php echo the_field('copyright_text','option'); ?></p>
 <?php endif; ?>