- This topic has 1 reply, 2 voices, and was last updated 8 years, 5 months ago by
Theme Horse Support Team.
-
AuthorPosts
-
January 27, 2017 at 8:03 pm #49630
Barry
ParticipantI am trying to edit the css file for my child theme and change some fonts – I didn’t want to use the theme editor to do it so that my changes would be saved. can you let me know how I go about doing this? I know the google fonts I want to use but when I make the changes they aren’t showing up? If I edit it in the theme editor it works, but doesn’t change my css file..
January 30, 2017 at 5:07 am #49660Theme Horse Support Team
KeymasterHi Barry,
What you need to do is first create child theme with two file (style.css and functions.php). If you have free theme installed then first remove the free theme and only add interface pro theme.This is an example how to unhook page 404.php and use your own content.
First of all you need to unhook the functions and then only customize the code in your child theme functions.php. Here is a simple example how to unhook functions and customize the code. Below code should be added inside functions.php of child theme.
Under style.css file add below code
Step 1:/* Theme Name: Interface Pro Child Theme URI: https://www.themehorse.com/themes/interface-pro Author: Theme Horse Author URI: https://www.themehorse.com Description: Interface Pro is a Simple, Clean and Flat Responsive Retina Ready WordPress Theme. It is easily customizable with numerous theme options. Some of the highlighted options are two site layout (Narrow and Wide), 4 layouts for every post/page, 5 Page Templates, 8 widget areas, 6 custom widgets, featured slider to highlight your post/page, 10 social icons, top and bottom info bar to hightlight your contact/email/location and many more. Also has custom background, header, menu, favicon, CSS, webclip icon, and logo. Supports popular plugins like Breadcrumb NavXT, WP-PageNavi and Contact Form 7. It is also translation ready. Get free support at https://www.themehorse.com/support-forum/ and View beautiful demo site at https://www.themehorse.com/preview/interface-pro Version: 3.0.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: white, light, green, two-columns, left-sidebar, right-sidebar, fluid-layout, custom-menu, custom-background, custom-header, featured-images, full-width-template, theme-options, threaded-comments, translation-ready, sticky-post Text Domain: interface Template: interface-pro */ @import url("../interface-pro/style.css");
If you like to add your own css add below this code
@import url("../interface/style.css");
Step 2:
Under functions.php file.
First do you like to use google font from our theme or font from outside any source?
If you are using google find from theme typography options then you can select font from theme options and you don’t need to create functions.php file. You can avoid step 2.If you are using google font that we dont have in theme options panel then do below step too.
under functions.php first you need to unhook the functions. There is already the google font and you need to unhook it and overwrite with your code.
// Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'wp_enqueue_scripts', 'interface_scripts_styles_method' ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook interface_header add_action( 'wp_enqueue_scripts', 'interface_scripts_child_styles_method' ); function interface_scripts_child_styles_method() { global $interface_theme_setting_value,$interface_default; global $array_of_default_settings; $options = wp_parse_args( get_option( 'interface_theme_options', array() ), interface_get_option_defaults()); $options_setting = $interface_theme_setting_value; /** * Loads our main stylesheet. */ // Load our main stylesheet. wp_enqueue_style( 'interface_style', get_stylesheet_uri()); wp_style_add_data( 'interface-ie', 'conditional', 'lt IE 9' ); if ('on' == $options['site_design']) { //Css for responsive design wp_enqueue_style( 'interface-responsive', get_template_directory_uri() . '/css/responsive.css'); } /** * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /** * Register JQuery cycle js file for slider. * Register Jquery fancybox js and css file for fancybox effect. */ wp_enqueue_script( 'jquery_cycle', INTERFACE_JS_URL . '/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true ); wp_register_script( 'jquery_fancybox', INTERFACE_JS_URL . '/jquery.fancybox-1.3.4.pack.js', array('jquery'), '1.3.4', true ); wp_enqueue_style( 'jquery_fancybox_style', INTERFACE_CSS_URL . '/jquery.fancybox-1.3.4.css', true); $interface_google_font_loads = array(); if( $interface_default['interface_general_typography'] != $options_setting[ 'interface_general_typography' ] ) : array_push( $interface_google_font_loads,$options_setting[ 'interface_general_typography' ] ); endif; if( $interface_default['interface_navigation'] != $options_setting[ 'interface_navigation' ] ) : array_push( $interface_google_font_loads,$options_setting[ 'interface_navigation' ] ); endif; if( $interface_default['interface_title'] != $options_setting[ 'interface_title' ] ) : array_push( $interface_google_font_loads,$options_setting[ 'interface_title' ] ); endif; if( 'PT Sans' == $options_setting[ 'interface_general_typography' ] || 'PT Sans' == $options_setting[ 'interface_navigation' ] ): array_push( $interface_google_font_loads,'PT+Sans'); endif; $interface_google_font_load = implode("|", $interface_google_font_loads); wp_register_style( 'interface_google_font', '//fonts.googleapis.com/css?family='.$interface_google_font_load .':400,700italic,700,400italic'); wp_enqueue_style( 'interface_google_font' ); /** * Enqueue Slider setup js file. * Enqueue Fancy Box setup js and css file. */ if( 'revolution-slider' != $options[ 'slider_type' ] && '0' == $options[ 'disable_slider' ] ) { if ( ( 'slider-on-everypage' == $options[ 'slider_status' ] ) || ( ( is_home() || is_front_page() ) && 'slider-on-homepage' == $options[ 'slider_status' ] ) ) { wp_enqueue_script( 'interface_slider', INTERFACE_JS_URL . '/interface-slider-setting.js', array( 'jquery_cycle' ), false, true ); } } wp_enqueue_script( 'interface_fancybox_setup', INTERFACE_JS_URL . '/interface-custom-fancybox-script.js', array('jquery_fancybox'), false , true); wp_enqueue_script( 'backtotop', INTERFACE_JS_URL. '/backtotop.js', array( 'jquery' ) ); wp_enqueue_script( 'scripts', INTERFACE_JS_URL. '/scripts.js', array('jquery') ); wp_enqueue_script( 'jquery_custom', INTERFACE_JS_URL. '/jquery.custom.js', array('jquery') ); wp_enqueue_script('easing', INTERFACE_JS_URL . '/jquery.easing.1.3.js', array('jquery'), true); wp_enqueue_script('quicksand', INTERFACE_JS_URL . '/jquery.quicksand.js', array('jquery'), true); wp_enqueue_style( 'jquery_fancybox_style' ); }
Note: Provide your font link here as
wp_register_style( 'interface_google_font', '//fonts.googleapis.com/css?family=Open+Sans');
Thank you! -
AuthorPosts
- You must be logged in to reply to this topic.