WordPress.org

Forums

Fashionistas
Second Google Font - How to Alter PHP Script (2 posts)

  1. rmventures
    Member
    Posted 11 months ago #

    Would like to add a second google font to the existing php script below (from functions.php), so we can use a different font on the body. Please advise.

    /**
     * Enqueue scripts and styles
     */
    function athemes_scripts() {
    	$protocol = is_ssl() ? 'https' : 'http';
    	$query_args = array(
    		'family' => 'Oswald:300,400,700',
    	);
    	wp_enqueue_style( 'athemes-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) );
    	wp_enqueue_style( 'athemes-symbols', get_template_directory_uri() . '/css/athemes-symbols.css' );
    
    	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' );
    	wp_enqueue_style( 'athemes-style', get_stylesheet_uri() );
    
    	wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ) );
    	wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ) );
    	wp_enqueue_script( 'supersubs', get_template_directory_uri() . '/js/supersubs.js', array( 'jquery' ) );
    	wp_enqueue_script( 'athemes-settings', get_template_directory_uri() . '/js/settings.js', array( 'jquery' ) );
    
    	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    		wp_enqueue_script( 'comment-reply' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'athemes_scripts' );
    
    define( 'ATHEMES_PATH', plugin_dir_path( __FILE__ ) );
  2. athemes
    Member
    Theme Author

    Posted 10 months ago #

    It might be easier for you to use a plugin: https://wordpress.org/plugins/easy-google-fonts/

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.