Viewing 29 posts - 1 through 29 (of 29 total)
  • Author
    Posts
  • #401511

    Hi, there. Can you tell me if there’s a hook that would allow me to move the page titles into the content area once I disable it in the theme options? I’ve looked at the for the header, page and loop templates and nothing is jumping out at me. If not, can you suggest a different approach?

    Thanks!

    #401929

    Hey Kevin!

    Thank you for using Enfold.

    Can you please provide a screenshot of what you’re trying to do with the title? If you build the page using the advance layout editor, edit template-builder.php. Look for the avia_title function.

    Cheers!
    Ismael

    #402320
    This reply has been marked as private.
    #402907

    Hi!

    If it was me then I would just hide the title with CSS in the page content and then add a special heading at the top of the page. There may come a time where you wish to create a page with a color section at the top or slider, etc etc, and you won’t be able to with this customization.

    Cheers!
    Elliott

    #402966

    I definitely get that approach but it won’t carry through onto all pages like Category pages, for example. It sounds like what I’m asking for doesn’t exist though, right?

    This probably boils down into a feature request but I really wish Enfold had hooks before and after each of the opening and closing tags for major layout areas so we could inject into the design without having to modify the template files themselves.

    #403262

    Hi!

    You can use this hook:

    add_action('ava_after_main_container', 'ava_after_main_container_mod');
    function ava_after_main_container_mod() {
    echo "<div class'custom-title'>TITLE HERE</a>";	
    }

    Cheers!
    Ismael

    #435517

    I think I’m looking for the same thing, here — a way to get automatic page titles, but in the body area, not in the strip with the breadcrumbs.

    In other words, If I choose “Hide Both” in the Header > Header Title and Breadcrumbs option/pull-down (because I don’t want that extra strip/row in the header), I lose my automated page titles. If I still want titles on my pages, I have to manually add them to each page (e.g., http://skidrow.org/work/ ). And yes, as Kevin mentions, then I don’t have titles on my category pages (e.g., http://skidrow.org/category/affordable-housing/ )

    So, is there a way to get the page titles to automatically show in the body area? Ismael’s hook looks close, except that the title would be the same for all pages, that way, right?

    Thanks and let me know if you have any questions.

    #436221

    Hey!

    Around line 39 in the single.php file you should see this.

    get_template_part( 'includes/loop', 'index' );
    

    Add this above it.

    the_title( '<h1>', '</h1>' );
    

    Cheers!
    Elliott

    #436251

    Thanks, but that only seems to add titles to single posts — I need titles on all pages and archive pages.

    #436252

    Thanks for the suggestion! This is definitely one of those situations where I’d love for there to be a hook we could piggyback on so we don’t have to edit the template or create a copy in a child theme.

    Thanks again tho!
    Kevin

    #437574

    Hi!


    @sky19er
    , In that case try above line 11 in the /includes/loop-index.php file.

    // check if we got posts to display:
    


    @kevinmcgillivray
    , If you use a hook then you would still have to edit the functions.php to use it. You could try the “ava_after_main_title” hook or perhaps prepend the title to “the_content” hook. That might have weird side effects though.

    Regards,
    Elliott

    • This reply was modified 9 years ago by Elliott.
    #437667

    Hey, it looks like maybe you didn’t paste the code in your response? All I see is “check if we got posts to display”,

    #437929

    @sky19er Elliott meant that instead of putting ‘the_title( ‘<h1>’, ‘</h1>’ );’ in single.php that you should put it in loop-index.php on line 11.


    @Elliott
    I’m not sure I understand what you mean about editing functions.php. If this was done with hooks, I could put the code in a child theme (perhaps in functions.php) or a plugin and accomplish the same thing. As it is, I either have to edit the actual Enfold theme file or I have to duplicate a file from Enfold into a child theme which takes that file out of the upgrade path when Enfold gets updated in the future. Am I misunderstanding what you’re suggesting?

    #438466

    Hey!

    You’re right, there isn’t a filter on that location right now so you’d need to use a child theme template overwrite (single.php will suffice).

    Regards,
    Josue

    #438621

    Sorry, that doesn’t seem to be any different, to me — that still creates duplicate title on posts (see link below) and still no automatic titles on pages. Again, the single posts are fine — they already have titles — what I need is automated page titles and titles for the category/archive pages (the title/name of the category at the top of the page). In other words, if we could somehow bring the titles that are generated in the header “strip” (the same strip where the breadcrumbs show) into the body area, we’d be in business ;) And I do have a child theme in-place, btw.

    https://www.evernote.com/shard/s320/sh/00a310d4-f62f-46cb-9b4a-515eda69986c/6ac06b95dad0ed1e7a05d31dadf0a5e6

    #438651

    Hi!

    Can you post the actual link to that? also an admin account would be helpful.

    Best regards,
    Josue

    #438667

    Well, I can’t leave the live site like that, but I’ll send you the admin account in private. Thanks and let me know if you have any other questions.

    #438669
    This reply has been marked as private.
    #440152

    Hi!

    Please go back to this post: https://kriesi.at/support/topic/move-page-title-out-of-band-out-of-the-header-and-into-the-content-area/#post-403262

    Just add the_title function:

    add_action('ava_after_main_container', 'ava_after_main_container_mod');
    function ava_after_main_container_mod() {
    	echo "<div class'custom-title'>".the_title()."</a>";	
    }

    Or use the ava_after_main_title hook:

    add_action('ava_after_main_title', 'ava_after_main_container_mod');
    function ava_after_main_container_mod() {
    	echo "<div class'custom-title'>".the_title()."</a>";	
    }

    Cheers!
    Ismael

    #440599

    Thanks, Ismael — that’s closer.

    Here’s what the first function does: https://www.evernote.com/shard/s320/sh/f753f1d3-cd78-4155-9a73-e8a911a5de6c/369ced36a93c0efed26d007ba74af645 — So, for one, that title’s still in a strip/row above the body area — I’m hoping to get it to show up IN the body area — in the main role=”main” area — where I currently have my manually inserted page titles.

    Also, that just adds the first post title to the top of the category pages, instead of the category title: https://www.evernote.com/shard/s320/sh/21482abe-ad3d-4778-810d-135a3e738cb0/f4f407c0c4673b435d51fdb2de8eec49

    AND, that still duplicates the post titles on single post pages, where the title’s already automatically being added to the page: https://www.evernote.com/shard/s320/sh/70600708-65c6-4309-9c78-aee2e1c2a48f/6c204c82f6d93d730de0e3174eb52853

    The ava_after_main_title hook doesn’t seem to do anything at all. A hook is the same thing as a function, right? I add that in my child theme functions.php file just like the_title function, right?

    Thanks!

    #441917

    Hey!

    Can you please provide a screenshot of the layout that you want? You can replace the code with this:

    add_action('ava_after_main_title', 'ava_after_main_container_mod');
    function ava_after_main_container_mod() {
    	echo "<div class'custom-title container_wrap'><div class='container'>".get_the_title()."</div></div>";	
    }

    Use the .custom-title selector to modify the style of the custom title. Remove the post default title with this:

    .single h1.post-title.entry-title {
      display: none;
    }

    Cheers!
    Ismael

    #442022

    Thanks Ismael, but there are still a few couple of problems with that:

    1) It still doesn’t seem to be getting down into the body area — it’s still butted up against the left edge of the browser — we can’t get it to show after the div class=container… or main class=content… tag?
    2) It still doesn’t show the category title on the category/archive pages — it still just shows the title of the first post on those pages.
    3) It doesn’t seem to be inside the custom-title div, so I don’t see how that selector would affect it.

    See this screen grab for those three issues:
    https://www.evernote.com/shard/s320/sh/585e37f5-8144-4a03-8107-c053accd840b/7d0cd953da6dd2d5d1d5b3a619a4cad4

    I’d like it to look like how I have the titles manually inserted now:
    https://www.evernote.com/shard/s320/sh/b9747b5c-4058-4932-843e-64bd725ec4c0/81eb14b9212f934d26915e4c77f73a6d

    Seems to me, whatever code you use to get the titles to show in the Header Title and Breadcrumbs strip would be the way to go — that code handles issue #2 above (getting the category/archive page titles to show.

    Thanks for your continued effort on this!

    #442030

    Hey!

    Why not insert a special heading element inside the page? I think that’s pretty easy to do, instead of adding custom modifications to the files.

    Cheers!
    Ismael

    #442052

    That’s how I have it now, but it’s kind of a drag having to manually add titles to every page, and change them manually, if the page name changes. But more importantly, I can’t add titles to the category/archive pages, unless I manually create a category/archive page for every category.

    If you want, we could work on just adding titles to the category pages — would that be easier? I just figured that, since it seems the theme has code to create titles for all pages in the Header Title and Breadcrumbs strip, we could maybe get that to show at the top of every body area instead.

    Thanks again!

    #442132

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #442156
    This reply has been marked as private.
    #442168

    This is an issue with a vanilla installation of Enfold as well. The problem is that there doesn’t seem to be any way to inject the page title into the <main></main> block without hacking the individual page templates. For example, index.php would have to have a do_action() call around line 35 that called something like ava_before_page_content() to accomplish this. You could then do something like this…

    add_action('ava_before_page_content', 'ava_custom_before_page_content');
    function ava_after_main_container_mod() {
    	echo avia_title();	
    }

    Unfortunately, there’s no hook like this but if it existed it would be a step toward opening up the design options on Enfold (which I LOVE; don’t get me wrong!).

    Thanks!

    #443557

    Hey!


    @sky19er
    , you forgot the URL of your site.


    @kevinmcgillivray
    , i think that’s a valid suggestion, please post it here.

    Cheers!
    Josue

    #444082

    http://skidrow.org/ — sorry, I figured you guys already had that from my many page references in this topic. Also, I had already sent you the url and user credentials on May 4th. Thanks.

Viewing 29 posts - 1 through 29 (of 29 total)
  • The topic ‘Move page title out of band out of the header and into the content area’ is closed to new replies.