[Resolved] update delete header.php stuff i putted

Home Forums Support update delete header.php stuff i putted

This topic contains 7 replies, has 2 voices, and was last updated by  Leo 8 months, 2 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #461812

    yael

    hi,
    i’m using generatepress theme and also child…
    when i updated the generatepress theme it removed all my code in header (which was font face stuff)
    what am i doing wrong?
    i should have a child theme (which installed) that on it i will add stuff and once there is an update to core theme nothing will change… so where should i put the font face codes and other stuff i need instead the main header PHP file of the core theme?

    http://a19121-tmp.s178.upress.link
    (it’s a test site)

    thanks

    GeneratePress 2.0.1
    GP Premium 1.5.6
    #461910

    Leo Customer Support

    Hi there,

    Updates definitely don’t erase modification you made in the child theme, you can imagine the complains we get by now πŸ™‚

    I think this hook is what you are looking for: https://docs.generatepress.com/article/wp-head/

    #461912

    yael

    no man… what i need to know is
    where to put the font face code… in the main theme? or child?
    now i’m putting it in the main theme in the header.php file
    is there somewhere else?
    inside the child theme?

    this is the code for an example (with the entire generatepress header provided code for the header:

    <?php
    /**
    * The template for displaying the header.
    *
    * @package GeneratePress
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly.
    }

    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
    <link rel=”profile” href=”http://gmpg.org/xfn/11″>
    <?php wp_head(); ?>
    </head>

    <style type=’text/css’>

    @font-face{
    font-family:’avigul’;
    font-weight:700; /*(bold)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-bold-fm.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-bold-fm.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-bold-fm.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-bold-fm.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’avigul’;
    font-weight:400; /*(regular)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-regular-fm.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-regular-fm.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-regular-fm.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-regular-fm.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’avigul-shadow-fm’;
    font-weight:800; /*(shadow)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-shadow-fm.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-shadow-fm.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-shadow-fm.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/avigul-shadow-fm.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’almoni-neue-aaa’;
    font-weight:400; /*(regular)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-400.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-400.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-400.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-400.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’almoni-neue-aaa’;
    font-weight:700; /*(bold)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-700.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-700.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-700.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-aaa-700.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’almoni-neue-tzar-aaa’;
    font-weight:700; /*(bold)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-tzar-aaa-700.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-tzar-aaa-700.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-tzar-aaa-700.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/almoni-neue-tzar-aaa-700.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’atlas-pro-aaa’;
    font-weight:500; /*(regular)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/atlas-pro-aaa-500.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/atlas-pro-aaa-500.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/atlas-pro-aaa-500.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/atlas-pro-aaa-500.ttf’) format(‘truetype’);
    }

    @font-face{
    font-family:’mikhmoret’;
    font-weight:400; /*(regular)*/
    font-style: normal;
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/mikhmoret-regular-aaa.eot’);
    src: url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/mikhmoret-regular-aaa.eot#iefix’) format(’embedded-opentype’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/mikhmoret-regular-aaa.woff’) format(‘woff’),
    url(‘http://a19121-tmp.s178.upress.link/wp-content/themes/generatepress/fonts/mikhmoret-regular-aaa.ttf’) format(‘truetype’);
    }

    </style>

    <body <?php generate_body_schema();?> <?php body_class(); ?>>
    <?php
    /**
    * generate_before_header hook.
    *
    * @since 0.1
    *
    * @hooked generate_do_skip_to_content_link – 2
    * @hooked generate_top_bar – 5
    * @hooked generate_add_navigation_before_header – 5
    */
    do_action( ‘generate_before_header’ );

    /**
    * generate_header hook.
    *
    * @since 1.3.42
    *
    * @hooked generate_construct_header – 10
    */
    do_action( ‘generate_header’ );

    /**
    * generate_after_header hook.
    *
    * @since 0.1
    *
    * @hooked generate_featured_page_header – 10
    */
    do_action( ‘generate_after_header’ );
    ?>

    <?php
    /**
    * generate_inside_container hook.
    *
    * @since 0.1
    */
    do_action( ‘generate_inside_container’ );
    #461915

    Leo Customer Support

    You should never add or modify any of main theme’s file – they will get erased.

    Take a look at this: https://docs.generatepress.com/article/adding-custom-font/

    #461916

    yael

    ok
    so what i’m asking and u’r not answering is,
    where should i put the code of the font face?
    inside the child theme. ok. but where?
    the child theme has: style.css and functions.php
    so where? inside one of them?
    i dont want to use any plugin. but only code.

    #461920

    Leo Customer Support

    It would be style.css.

    You can see from your code above that it’s wrapped in <style type=’text/css’> </style> and the link I provided suggested that it’s CSS.

    #461925

    yael

    ok
    got it! it’s working! thanks.
    so everything i need is only to do on the child – that’s why it was created πŸ™‚ right?

    #461967

    Leo Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.