[Resolved] Newbie Question(s)

Home Forums Support [Resolved] Newbie Question(s)

Home Forums Support Newbie Question(s)

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1931799
    Jeff

    I’m new to WordPress (but not blogging) and have been mostly frustrated with customization options. I bought a GeneratePress license because among a dozen or so themes I tried, it was closest to what I wanted and the premium version promised that customizing further was part of the package.

    Working with the stock GeneratePress templates, I can’t figure out whether the sort of customization I want to do requires more skills and patience than I have, or if I’m just not looking in the right places. Basically, I want to change (slightly) how each post is presented.

    For example: Every related-posts plugin I’ve found outputs to the area between the post itself and the meta block. I want to move one of those elements (related posts->lower or meta block->higher), but I can’t find an easy way to do that.

    Another example: On posts, I’d like to add some meta information (category) before the post — maybe above the title, maybe as part of the meta block that already precedes the post. Again, I can’t find an easy way to do that.

    Am I missing something?

    I’m not asking for specific solutions to those examples. I simply want to know my options for accomplishing these things.

    1) Is there away to accomplish this sort of thing in Appearance->Customize? It seems like there should be some place that treats the post template the same way WP treats the sidebars — that is, composed of blocks that can be arranged, added to, and subtracted from however one pleases.

    2) If not, is there some intuitive way to do this for somebody who doesn’t know php? I really don’t (yet) understand how page-builders work in relation to an existing theme, but could I accomplish what I want through something such as Elementor?

    3) If not, is it better to approach this using the theme editor (or creating a child theme) or by some combination of elements, hooks, and disable elements? (So, in my first example, I might disable the current meta-block element and add a hook element at the end of the post but before related entries. In the second example, I’ve been able to create a new element above the headline and I’ve been able to output the headline there with a php hook, but I can’t figure out how to output the category/categories. Again, I don’t know php!)

    4) Am I even asking the right questions?

    I can muddle my way through html and css stuff, and have already modified the theme through additional css. I just can’t figure out how to make changes to template structures without having to get seriously under the hood of WP or GP.

    #1932072
    Elvin
    Staff
    Customer Support

    Hi Jeff,

    I think seeing these videos would give you an idea on how to do things. Especially your concern about #2.


    It’s basically “Block Element – Content Template”.

    It’s Tom’s take on having a page builder using WordPress default’s Gutenberg Editor. 😀

    #1932113
    Jeff

    Elvin: Thanks. I’ll take a look.

    Am I correct that there’s no way outside of editing the template files to modify the stock presentation? It looks to me on quick review that one has full customization options creating a block from scratch. But if it’s an existing template that you want to change (and you don’t know php), your best bet is to try to re-create it.

    #1932124
    Elvin
    Staff
    Customer Support

    Am I correct that there’s no way outside of editing the template files to modify the stock presentation?

    There is but it’s a bit complicated as it requires PHP coding.

    You either code your own Child theme template or unhook the meta and re-hook it somewhere else. That’s completely customizable but that requires an understanding of PHP codes, WordPress theming, and WordPress codex.

    This applies to stock and site library templates. (some library templates unhook and/or re-hook things)

    #1932537
    Jeff

    Pretty much what I feared. Thanks!

    #1933246
    Elvin
    Staff
    Customer Support

    Pretty much what I feared. Thanks!

    We can always help you out if you want to try. As long as its only moving things around and its only within the theme’s action hooks and filters. 😉

    No problem. 😀

    #1933302
    Jeff

    If you insist … .

    So I think I have a decent feel for what hooks are and where they can be implemented.

    One challenge with fine-tuning a theme’s appearance with meta stuff is that the meta stuff isn’t separated from the content in terms of possible hook areas. On a posts page, the summary, “read more” link, and meta info are all one area. On a single post, the post-title content and meta info are all in one area. (I don’t understand the logic behind that choice, but … whatever. Shouldn’t every building-block component be its own thing?)

    So if I’d like the category/categories to appear above the entry title (like a file-folder label) instead of in the meta area below the post or summary, I could relatively easily create a hook element before the entry title. I just need the php to output the category/categories. (Again, I don’t know php.)

    However, assuming I’d then want to remove the category/categories from the meta area, I’d need to create an entirely new content/meta area to replace the old one that has the category/categories.

    Alternatively, I could simply make the category/categories in the meta area invisible through additional css.
    I.e.:

    .cat-links {
    display:none;
    }

    Then I’d just need the php to output the category/categories.

    Is all that correct?

    If so, questions:

    1) What’s the php for outputting category/categories, and how does one change it for different separators? (E.g. “Movies, Books” vs. “Movies | Books” vs. “Movies/Books”.)

    2) I assume I’d want to assign a class to that output so that it can be styled through css. Correct? If so, what does that look like in the hook element?

    3) Is the approach I’m suggesting — new hook element before the title, additional css to hide that area in the meta — the most-efficient approach to this particular problem? Better than re-creating that content block, and better than diving into the theme code?

    #1933339
    Elvin
    Staff
    Customer Support

    So if I’d like the category/categories to appear above the entry title (like a file-folder label) instead of in the meta area below the post or summary, I could relatively easily create a hook element before the entry title. I just need the php to output the category/categories. (Again, I don’t know php.)

    My recommendation would be to familiar with WordPress codex and its functions.

    Here’s an example function: (for listing category links)
    https://developer.wordpress.org/reference/functions/get_the_category_list/

    Which is actually being use on post meta of the theme – https://github.com/tomusborne/generatepress/blob/2c7c8a76d3b58b0b97e82b3a7a5ebf022a1ddfbe/inc/structure/post-meta.php#L238

    The theme files/codes are open for public –
    https://github.com/tomusborne/generatepress

    You can check this repository to have familiarity with what hooks and filters are being used.

    Alternatively, you can use the hook layout provided here for reference –
    https://docs.generatepress.com/article/hooks-visual-guide/

    For #1:

    You can filter what separator is used using this filter.
    https://docs.generatepress.com/article/generate_term_separator/

    But keep in mind that it has limitations.

    Say, for example, you want to assign different separators for tags and categories. In this case, you can’t use this filter because this will apply to both taxonomy metas.

    In this case, you’ll have to modify the actual category and tag meta outputs if you want to assign different separators on each of them.

    generate_category_list_output for categories – https://docs.generatepress.com/article/generate_category_list_output/
    generate_tag_list_output for tags – https://docs.generatepress.com/article/generate_tag_list_output/

    2) I assume I’d want to assign a class to that output so that it can be styled through css. Correct? If so, what does that look like in the hook element?

    Not necessarily. You can use the existing class selectors to style things. But if you want to add extra classes, the output filters I’ve provided on the previous question can be used.

    3) Is the approach I’m suggesting — new hook element before the title, additional css to hide that area in the meta — the most-efficient approach to this particular problem? Better than re-creating that content block, and better than diving into the theme code?

    I’d suggest going with creating the contempt template with Block Element – Content Template so what you see as the layout will be completely up to you since you’ll be the one designing it.

    But your approach can work. That’s actually what we do prior to Block Element – Content Template implementation (prior GP Premium 2.0).

    As for the “hiding part” you can either just hide it with CSS or completely remove it from render by disabling it from the Customizer setting. (Appearance > Customize > Layout > Blog. uncheck the “display” boxes)

    #1934123
    Jeff

    So I think I’ve figured this out. Here’s what I think you were recommending, in the event that anybody comes across this in the future:

    1) Appearance->Elements.

    2) New Element.

    3) Set “Element Type” to “Content Template.”

    4) Add a container block.

    5) Within that, add a button.

    6) Set the dynamic content to the category.

    7) Style.

    8) Set Location Rule.

    9) Publish.

    10) Hide the category meta information via Appearance > Customize > Layout > Blog.

    Is that about right?

    As a side note: That was way easier than I expected, but the GeneratePress/GenerateBlocks documentation is … not geared to a general population. I think you’d get a lot more paying customers (and a lot fewer support tickets) with some simple, clear written and video tutorials on how to do a few things — starting a theme from scratch, modifying one aspect of an existing theme using a content-block element, etc. I hate tutorial videos, and I’m sure others hate written tutorials; you need both, and the current documents don’t provide much of an overview. (However, the buttons overview at docs.generateblocks.com is great. I wish something similar existed for the whole package overall.)

    One last question: If I were to want to replace the entire entry-content block in an existing theme through Elements, what’s the process? I’d start by creating new content blocks, but what would happen to those in the existing theme? Or is that not even possible? (That is: Doing that would create two entry blocks, and you can’t get rid of one of them.)

    #1934887
    Elvin
    Staff
    Customer Support

    That’s about right except for maybe #3.

    #3 will depend on what you’re editing. If you want to edit the whole layout (divisions, order of how things are arranged, colors, etc) for the post, you use “Block Element – Content Template”.

    But if you only want to change the meta, you use “Block Element – Post meta”.

    As a side note: That was way easier than I expected, but the GeneratePress/GenerateBlocks documentation is … not geared to a general population. I think you’d get a lot more paying customers (and a lot fewer support tickets) with some simple, clear written and video tutorials on how to do a few things — starting a theme from scratch, modifying one aspect of an existing theme using a content-block element, etc. I hate tutorial videos, and I’m sure others hate written tutorials; you need both, and the current documents don’t provide much of an overview. (However, the buttons overview at docs.generateblocks.com is great. I wish something similar existed for the whole package overall.)

    I definitely agree. It’s a work-in-progress. 😀

    Eventually, we’ll be able to tie-in the youtube videos to their appropriate documentations. 🙂

    One last question: If I were to want to replace the entire entry-content block in an existing theme through Elements, what’s the process? I’d start by creating new content blocks, but what would happen to those in the existing theme? Or is that not even possible? (That is: Doing that would create two entry blocks, and you can’t get rid of one of them.)

    You start with 3) Set “Element Type” to “Content Template.”.

    From #3, you place a block for each part of the entry-content you want to include.

    Here are the things which are normally added to the single posts page layout.

    Title – (I recommend using GenerateBlocks’ Headline Block – dynamic value – Title)
    Post meta (top side,before content) – (you can use GenerateBlocks’ Headineblock for dynamic post meta value as well)
    The actual content of the post – ( you can use the “Dynamic content” block and set the type to “post content” ).
    Post meta (bottom side,after content) – (you can use GenerateBlocks’ Headineblock for dynamic post meta value here too)

    If you do a “Block Element- Content Template”, you generally don’t have do to “Block Element – Post meta” because you’ve already done the layout customization of the post meta when you set it up inside the “Block Element- Content Template” you’ve created. 😀

    #1935923
    Jeff

    Thanks! Once I got a sense — any sense! — of how everything works together with GeneratePress and GenerateBlocks, things started clicking into place. The system is much more powerful — and much easier — than you’d know from the promotional materials and documentation. I hope that gets fixed soon!

    #1936093
    Elvin
    Staff
    Customer Support

    GP’s list of functions/features is still growing. We’ll try to improve it as we add more along the way.

    No problem. 😀

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