badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Mags CHILD THEME

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #82630
    lukyeslu
    Participant

    Hello, i want to add something in the functions file for a kind of forum that I have in the website but I just want to know how to create and what should code i write for the MAGS PRO child theme.

    Thank you!

    #82746

    Hi lukyeslu,

    First Create a New Folder with ‘newscard2’ on Theme Directory (Here we are giving you example for Child Theme as ‘newscard2’). Then inside ‘newscard2’ directory, create a ‘function.php’ with the content below.

    <?php
    add_action( 'wp_enqueue_scripts', 'newscard2_enqueue_child_styles' );
    function newscard2_enqueue_child_styles() {
     
        $parent_style = 'newscard-style';
     	
     	 wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/library/bootstrap/css/bootstrap.min.css', array(), '4.0.0');
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'newscard2',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    
    require get_stylesheet_directory() . '/xyz.php';

    you can link your one are more file like xyz.php with customized code in it.

    also create a style.css file on Child Theme directory ‘newscard2’ with content below.

    /*!
    Theme Name: NewsCard2
    Theme URI: https://www.themehorse.com/themes/newscard
    Author: Theme Horse
    Author URI: https://www.themehorse.com/
    Description: NewsCard Child Theme
    Template: newscard
    Version: 1.0.0
    Requires PHP: 5.2
    Tested up to: 5.5.3
    License: GNU General Public License v3 or later
    License URI: http://www.gnu.org/licenses/gpl-3.0.html
    Text Domain: newscard2
    Tags: blog, entertainment, news, two-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-logo, custom-menu, featured-image-header, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
    */

    Now you can customize the Theme with any style with style.css file.

    For more you can find the easy guide and tutorials for creating Child Theme on different blogs or on official WordPress.org

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.