• Resolved Jimmi

    (@jimmi61)


    For a new theme I created a home.html template with this line on top:

    <!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

    I created a header.thml part with this code:

    <!-- wp:pattern {"slug":"7girello/header"} /-->

    and a header.php pattern with this line among the rest:

    <!-- wp:site-title {"level":0,"fontSize":"large"} /-->

    I changed the fontSize to x-large but nothing changed. I controlled again all the code in the various files and try some test to debug it, finally I end up to place 2 lines in home.html as follows:

    <!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
    <!-- wp:pattern {"slug":"7girello/header"} /-->

    I then obtained 2 titles, the first with ‘large’ size and the second with ‘x-large’ size.

    I repeated exactly the same schema template->part->pattern for the footer and changing the fontsize of title works there with no troubles.

    I’m quite confused now why this behaviour happen.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi

    Can you share the URL?

    Can you expand on the purpose of HTML files incorporated with WordPress?

    Thread Starter Jimmi

    (@jimmi61)

    It looks like something related to the docker environment. Once I loaded the theme on Hostinger the problem disappear, but in docker on different machines with different OS the problem replicates. It seems that the instruction ′fontSize’ has no effect when I use header.html part, either with x-large or small, but it works if I point the pattern in home.html

    The code is:

    home.html

    <!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
    <!-- wp:pattern {"slug":"7girello/header"} /-->
    <!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0","margin":{"top":"0"}}},"layout":{"type":"default"}} -->
    <main class="wp-block-group" style="margin-top: 0">
    ?<!-- wp:pattern {"slug":"7girello/page-home-blogging"} /-->
    </main>
    <!-- /wp:group -->
    <!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->

    header.php

    <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"0px"}}},"backgroundColor":"base","layout":{"type":"constrained"}} -->
    <div
    ?class="wp-block-group alignwide has-base-background-color has-background"
    ?style="padding-top: 20px; padding-bottom: 0px"
    >
    ???<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
    ???<div class="wp-block-group">
    ?????<!-- wp:site-logo {"width":60} /-->
    ?????<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
    ?????<div class="wp-block-group">
    ???????<!-- wp:site-title {"level":0,"fontSize":"x-large"} /-->
    ?????</div>
    ?????<!-- /wp:group -->
    ???</div>
    ???<!-- /wp:group -->
    ???<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"left"}} -->
    ???<div class="wp-block-group">
    ?????<!-- wp:navigation {"ref":4,"icon":"menu","style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex","justifyContent":"left","
    orientation":"horizontal","flexWrap":"wrap"}} /-->
    ???</div>
    ???<!-- /wp:group -->
    </div>
    <!-- /wp:group -->

    I’ll try to investigate more…

    Thread Starter Jimmi

    (@jimmi61)

    Finally I understood that everything was caused by small mistakes in the code, that caused the theme to behave different in the 2 environments. I adjusted the code and finally the results aligned between local docker env and Hostinger.

    I’m sorry to bother you for nothing.

    That is good news.

    As far as I know, I can’t close as resolved as it is your thread.

    The FAQs suggest:

    How do I mark my post as solved?
    There’s a drop-down on the right side of the post for ‘status’, which includes options to resolve your post. You can also use the checkboxes at the bottom of the reply form, to reply and mark a post solved.

    If still stuck with the status change, you can ask a moderator to close it.

    Thread Starter Jimmi

    (@jimmi61)

    Sorry for being late, I’ll pay more attention in future ??

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