Category: Wordpress

  • WordPress Template Hierarchy

    WordPress Template Hierarchy

    WordPress Template Hierarchy

    Every Template in wordpress has a corresponding php file. I have added the php files that each template uses. Below is a table with further explanations for each template.

  • WordPress Gutenberg Block editor – Query loop – Mobile Friendly queries.

    WordPress Gutenberg Block editor – Query loop – Mobile Friendly queries.

    WordPress Gutenberg Block editor – Query loop – Mobile Friendly queries.

    How to use the query loop: You can display a query loop either as Vertical List or as a Grid.

    Query loop as a Grid

    1. Select the Post Template and choose “grid”
    2. Select the Grid in list view > style > choose minimum Height 100%: Now every grid-box that contains a post entry will span the full height of its container (if you set a background color to the grid, you will see that the background fills the whole grid)
      • Set Grid item Position to Auto. If you set it to manual choose Columns 1.
    3. Optional: Add a stack inside the Grid (so grid is parent): Then place Title, Featured image and Date inside stack.
      • Now set stack Justification to “Stretch items ” It makes all child blocks inside the Stack stretch to the full available width of the container. Optionally you could also choose “center”
      • Set orientation: Vertical
      • Stack Layout : Justification Grid item position
    4. Below I’ve created a border around the Grid (outer border) and the Stack (inner border): Here is the list view Structure
    5. Center the text
    query loop

    This is how the Query loop result will look on your page

  • WordPress Gutenberg Block editor – Columns, Stacks and Groups

    How to build a 3 column layout with gutenberg Block editor that is mobile-friendly.

    When you build a 3-column layout you have 3 columns within a parent column container. Notice that I gave each column a border. Columns don’t give you the option to stretch the column to take up 100% height of its parent container, so if you look at the image below you can see that column 1 is not taking up the full space of its parent container. Only stacks allow this, option, not columns. Also If you place the blocks (Header, image, paragraph, button) within each Column. You cannot push the button to the bottom if

    Solution Add a stack

    1. You have 3 columns winin a parent column container. 
      • Set outermost parent column to “Stack on mobile” This way each column will stack on top of the other on a mobile device instead of having each column side by side.
    2. within each column you have 1 stack.  
      1. Stack settings:
        1.  Change vertical alignment to “space between” 
    3. Within the stack you have 2 groups
      1. Button group
        1. Justify Center: 
        2. The button group: Set bottom margin which lifts it up from the bottom.

    Col1 GroupA

    Paragraph text col 1 groupA

    Col2 GroupC

    Paragraph text col 2 Group C . Contains an extra line.

    Col3 Group E

    Paragraph text col 3 stack E.. This has two or three extra lines taking up more space.

    That’s how you use Columns and Stacks to create evenly spaced buttons / other block elements inside a column container.