-
AuthorPosts
-
February 24, 2015 at 5:00 pm #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!
February 25, 2015 at 10:10 am #401929Hey 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!
IsmaelFebruary 25, 2015 at 8:15 pm #402320This reply has been marked as private.February 26, 2015 at 6:51 pm #402907Hi!
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!
ElliottFebruary 26, 2015 at 8:33 pm #402966I 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.
February 27, 2015 at 9:12 am #403262Hi!
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!
IsmaelApril 27, 2015 at 6:53 pm #435517I 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.
April 28, 2015 at 5:32 pm #436221Hey!
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!
ElliottApril 28, 2015 at 6:07 pm #436251Thanks, but that only seems to add titles to single posts — I need titles on all pages and archive pages.
April 28, 2015 at 6:07 pm #436252Thanks 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!
KevinApril 30, 2015 at 4:38 pm #437574Hi!
@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, 7 months ago by Elliott.
April 30, 2015 at 6:35 pm #437667Hey, it looks like maybe you didn’t paste the code in your response? All I see is “check if we got posts to display”,
May 1, 2015 at 7:30 am #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?May 3, 2015 at 8:09 am #438466Hey!
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,
JosueMay 3, 2015 at 10:59 pm #438621Sorry, 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.
May 4, 2015 at 1:12 am #438651Hi!
Can you post the actual link to that? also an admin account would be helpful.
Best regards,
JosueMay 4, 2015 at 2:40 am #438667Well, 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.
May 4, 2015 at 2:41 am #438669This reply has been marked as private.May 6, 2015 at 7:44 am #440152Hi!
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!
IsmaelMay 6, 2015 at 7:33 pm #440599Thanks, 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!
May 9, 2015 at 8:39 am #441917Hey!
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!
IsmaelMay 10, 2015 at 2:19 am #442022Thanks 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/7d0cd953da6dd2d5d1d5b3a619a4cad4I’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/81eb14b9212f934d26915e4c77f73a6dSeems 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!
May 10, 2015 at 4:05 am #442030Hey!
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!
IsmaelMay 10, 2015 at 6:24 am #442052That’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!
May 10, 2015 at 7:26 pm #442132Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueMay 10, 2015 at 10:47 pm #442156This reply has been marked as private.May 11, 2015 at 2:14 am #442168This 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!
May 13, 2015 at 6:54 am #443557Hey!
@sky19er, you forgot the URL of your site.
@kevinmcgillivray, i think that’s a valid suggestion, please post it here.Cheers!
JosueMay 14, 2015 at 4:50 am #444082http://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.
-
AuthorPosts
- The topic ‘Move page title out of band out of the header and into the content area’ is closed to new replies.