• Resolved juuhachigo

    (@juuhachigo)


    Hi all,

    it’s exactly what it says on the tin :).

    I’ve been using Undescores for a very long time now, and I’ve never had a serious problem with it… until now.
    I am using version 5.4.1 with a local XAMPP installation, because I want to have my new blog fully operational from the moment it goes live. I have customised header, footer and the CSS file, but it seems that only index.php recognizes my custom header and footer. The other parts (single.php, archive.php etc.) won’t take it. I have tried everything and still got no result at all. Example screenshots here:

    has anything like that ever happened to anyone before? can it be a simple media query problem?

    PS: yeah, I know the style looks like crap, but it’s still a WIP thing XD

    • This topic was modified 4 years, 6 months ago by juuhachigo.
    • This topic was modified 4 years, 6 months ago by Jan Dembowski.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Last I looked at underscores, it doesn’t load any CSS file. It looks like your second two screenshots have no CSS applied.
    We can’t debug your theme from a screenshot, though. You will need to work through it.
    Have you read the Theme Developer Handbook?

    Thread Starter juuhachigo

    (@juuhachigo)

    Thank you so much. Yes, that sems to be the problem, but the thing is, Underscores does load the css file via

    function cartabianca_scripts() {
    	wp_enqueue_style( 'cartabianca-style', get_stylesheet_uri(), array(), _S_VERSION );
    	wp_style_add_data( 'cartabianca-style', 'rtl', 'replace' );
    
    	wp_enqueue_script( 'cartabianca-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
    
    	wp_enqueue_script( 'cartabianca-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), _S_VERSION, true );
    
    	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    		wp_enqueue_script( 'comment-reply' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'cartabianca_scripts' );

    Judging from the pink on the links in the theme’s sngle post, I gather it recognized some of it… I’ll recheck the whole code again and let you guys know!

    EDIT: I looked at my header and footer files and, as you can see in the single.php screenshot, the footer is evidently different: it’s the standard Underscores one, rather than the Lorem Ipsum I customized myself, but it still retains some of the css I spcified, so it’s not strictly a CSS problem.

    • This reply was modified 4 years, 6 months ago by juuhachigo.
    • This reply was modified 4 years, 6 months ago by juuhachigo.

    Are you calling get_header() and get_footer() in single.php and archive.php?
    And do those have the wp_head() and wp_footer() calls in them? (that’s where the scripts and styles are output)

    When you say that you see the standard underscores footer instead of the one you customized, does that mean that there are two copies of the file? Are you making a child theme? Are you using a cache?

    Thread Starter juuhachigo

    (@juuhachigo)

    1) Yes, in both files.
    2) Yup to that as well
    3) I have tried modifying header and footer, so that I could use get_header() and get_footer(), and also tried using get_header('custom') and get_footer('custom') . Neither seemed to work.
    4) No, I didn’t use a child theme and I honestly don’t know whether I was using a cache, but I managed to fix it and it did seem to be some kind of cache problem.
    Apparently, WordPress wasn’t recognizing the various files as part of the theme, but I accessed the dashboard > Settings, updated the permalinks and it suddenly started working °_°. I’ve never seen anything like that before, ever.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Underscores Cannot recognize header.php and footer.php’ is closed to new replies.