-
AuthorPosts
-
November 12, 2014 at 4:44 am #349846
This is the deepest I’ve gone with modifying a theme, so maybe I need to do something drastically different.
I have a child theme, which is working for the most part The client didn’t want the title in the header, so I’ve turned that off in the Settings > Header configuration.
I added a blue bar with two forms, and I _expect_ there’s a smarter way to do that. I currently have it as common blocks in an Advanced Editor template, but I was trying to copy/paste the resulting HTML into a custom header.php so that it would easily appear on all pages.
I _did_ add that to my custom header, and I _think_ that will work, but I’m not positive as this next part might complicate things.
The client wants to display the page title at the top of their Main Content. I modified a page.php in my child folder, but it only works for plain pages. When pages are created with the Advanced Editor, then different pages are used. I hunter all around to find where would be a good place to put “echo avia_title()”, but I haven’t found one.
So, my question to you is… can you suggest a way to consistently place the Title at the top of each pages Main Content? Presume that we’re talking about any page that uses the Default Template. Since the Home Page is using the Blank template, I wouldn’t want the title to appear there.
Thanks in advance!
November 12, 2014 at 4:45 am #349847A second, likely related, question is…
Can I place a “previous/next” control on Blog Pages?
November 12, 2014 at 9:48 pm #350367Hi!
Thank you for using Enfold.
You can add this on functions.php if you want to add the page title automatically for pages created with the advance layout builder:
add_filter('avf_template_builder_content', 'avf_template_builder_content_title', 10, 1); function avf_template_builder_content_title($content = "") { $title = avia_title(); return $title . $content; }
There’s actually an existing previous / next arrow on blog post pages. You can find it on both side edges of the single post page.
Best regards,
IsmaelNovember 13, 2014 at 1:10 am #350532I’ve added that function to my child theme’s functions.php, but the title doesn’t show on pages, even when the Advanced Editor is used. Is there more I should do?
Which files in the theme generate the pages? Is there documentation on this aspect of Enfold? I know of the following, but I’m not certain of when they’re used:
– page.php (for single Pages without the Advanced Editor)
– template-builder.php (for pages/posts WITH the Advanced Editor…?)
– archive.php
– single.php
– …others?Then there are files that loop on content, right?
I’ll post a page that has the modified “functions.php” in play in a private comment.
November 13, 2014 at 1:34 am #350536This reply has been marked as private.November 13, 2014 at 1:46 am #350541As far as the next/previous links for blog posts, the client would like them (also?) on the bottom of each post.
November 14, 2014 at 5:41 am #351132Hey!
Yes, you’re correct regarding the template files but it is much easier to use this filter. If you’re planning to add it on posts, products, page(Default Editor) etc, you might need to manually add it on the template files. The solution above actually works on our installation. Make sure that the Header Title and Breadcrumbs on Enfold > Header is enabled. You can hide the default title container with this:
#main > .stretch_full.container_wrap.title_container { display: none; }
Or you can replace the code with this:
add_filter('avf_template_builder_content', 'avf_template_builder_content_title', 10, 1); function avf_template_builder_content_title($content = "") { $title = get_the_title(); return $title . $content; }
Regarding the blog post navigation, you can use the get_previous_post and get_next_post function on loop-index.php file. Refer to these links for more info:
http://codex.wordpress.org/Function_Reference/get_previous_post
http://codex.wordpress.org/Function_Reference/get_next_postCheers!
IsmaelNovember 14, 2014 at 1:58 pm #351235Well, I got it working on my test page (above), but that uses page.php. It displays regardless of what the theme header settings are, which is okay; title & sidebar are turned OFF. Here’s the code I changed:
<?php global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header('signwave'); // if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title(); ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div class='container'> <main class='template-page content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>> <!-- BURT ADDED PAGE TITLE HERE --> <h1><?php echo get_the_title(); ?></h1> <!-- BURT ADDED PAGE TITLE HERE --> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-page.php and that will be used instead. */
When I try to apply the code to a template-builder.php page, using the “add_filter()” approach that you suggested, then the title is in it’s own full-width section, above the entire body area (both left margin and page content columns). I’d like the title to be above the page content, like it is on the test page.
Is that possible with just more CSS, or can I use a different filter, maybe one above the body?
November 15, 2014 at 6:45 am #351699Hey!
Did you replace the code with this?
add_filter('avf_template_builder_content', 'avf_template_builder_content_title', 10, 1); function avf_template_builder_content_title($content = "") { $title = get_the_title(); return $title . $content; }
This will only render the page title, not the whole title container.
Regards,
IsmaelNovember 15, 2014 at 12:07 pm #351783Woohoo!!! I got the title working exactly the way I wanted. By doing so, I also enabled my modified header.php with my blue header bar.
Only thing left to do is add the blog navigation links, but I think I have that under control. I’ll double-back when I implement that, then announce the site here.
Thanks, Ismael!!! You rock!
November 16, 2014 at 3:28 pm #352016Hi!
Glad you made it worked. I’m sure you can handle the pagination. For reference, you can find the default pagination code on functions-enfold.php file. Look for the avia_post_nav function. :)
Cheers!
IsmaelNovember 17, 2014 at 7:14 pm #352628Just about to work on that, but one new question came up:
Which template is used for the “no search results” page here: http://signwaveli.com/nothingfound
November 18, 2014 at 2:50 pm #352977November 18, 2014 at 7:30 pm #353193Thanks for the tip, Yigit. Turns out, I modified the /enfold/404.php file to use my custom header instead.
So, here’s the site for public display: http://www.signwave.comI have just one more thing on my todo list, and that’s to style the forms inside the blue bar to be responsive. Other than that, I’m feeling pretty great about this site!
Thanks for all you ongoing support, Team Kriesi.at!!! Y’all rock!
- This reply was modified 10 years ago by launchmoxie.
November 18, 2014 at 7:57 pm #353209Ah, help with an odd error, por favor…
My client just used a Full Width Button on one of his pages (http://signwaveli.com/about-signs/), and it throws an error:
Notice: Undefined index: index in /var/www/signs/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/buttons_fullwidth.php on line 346 Notice: Undefined index: index in /var/www/signs/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/buttons_fullwidth.php on line 346 Notice: Undefined index: index in /var/www/signs/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/buttons_fullwidth.php on line 346
Can you help with this?
November 18, 2014 at 11:08 pm #353316Hi!
Please download a fresh Enfold theme from ThemeForest and replace buttons_fullwidth.php file that is inside Enfold/config-templatebuilder/avia-shortcodes folder via FTP.
Have you made any changes on buttons_fullwidth.php file?Regards,
YigitNovember 19, 2014 at 12:42 am #353390I didn’t make any changes that I know of.
I replaced the file, but I still get an error message.
November 19, 2014 at 1:14 am #353407Weird. It was something in one of the buttons. I recreated the third button, and the error message went away.
November 20, 2014 at 2:41 am #354098Hi!
glad you fixed it! Let us know if you have any other issues.
Best regards,
Andy -
AuthorPosts
- You must be logged in to reply to this topic.