Tagged: breadcrumbs, shortcode, yigit
-
AuthorPosts
-
August 22, 2015 at 11:22 am #491707
Hi guys,
I would like to use the shortcode for breadcrumbs. So, I read this post: http://kriesi.at/documentation/enfold/inserting-breadcrumbs-as-shortcode/ and this post: https://kriesi.at/support/topic/whats-wrong-breadcrumb-as-shortcode-doesnt-work/
I tried to copy paste everything (using a child theme) but then I blew up wordpress again. Obviously I’m doing something wrong. :D
What I did:
First I commented out the function in template-builder.php and dragged it to my child theme folder.
//check if we want to display breadcumb and title
//if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title();Then I copied the whole function in functions-enfold.php to my function.php in my childtheme:
//advanced title + breadcrumb function
if(!function_exists(‘avia_title’))
{
function avia_title($args = false, $id = false)
{
global $avia_config;if(!$id) $id = avia_get_the_id();
$header_settings = avia_header_setting();
if($header_settings[‘header_title_bar’] == ‘hidden_title_bar’) return “”;$defaults = array(
‘title’ => get_the_title($id),
‘subtitle’ => “”, //avia_post_meta($id, ‘subtitle’),
‘link’ => get_permalink($id),
‘html’ => “<div class='{class} title_container’><div class=’container’><{heading} class=’main-title entry-title’>{title}</{heading}>{additions}</div></div>”,
‘class’ => ‘stretch_full container_wrap alternate_color ‘.avia_is_dark_bg(‘alternate_color’, true),
‘breadcrumb’ => true,
‘additions’ => “”,
‘heading’ => ‘h1’ //headings are set based on this article: http://yoast.com/blog-headings-structure/
);if ( is_tax() || is_category() || is_tag() )
{
global $wp_query;$term = $wp_query->get_queried_object();
$defaults[‘link’] = get_term_link( $term );
}
else if(is_archive())
{
$defaults[‘link’] = “”;
}And I added directly beneath it:
add_shortcode( ‘bread_crumb’, ‘avia_title’ );
And then I broke WordPress and got a parse error :D
What am I doing wrong, how can I fix it?
Sincerely,
MortickaAugust 24, 2015 at 4:11 pm #492309Hey Barb!
Can you please undo all the changes you made and create a temporary admin login and post it here privately so we can apply the changes for you?
If you do not mind posting FTP access, please post it as well just in case we blow WordPress up too ;DBest regards,
YigitAugust 25, 2015 at 2:30 pm #492939Hi Yigit,
Haha, of course. :)
Everything is restored and the rest of the login information is in the private data.
Sincerely,
BarbAugust 25, 2015 at 4:24 pm #493053Hey Barb!
Changes are done. I have created a private page called “test page” and confirmed. Please review your website now :)
Best regards,
YigitAugust 26, 2015 at 7:40 am #493326Hii Yigit,
Thx, it’s almost what I’m looking for! :)
Couple of questions?
1. How can I just use the breadcrumb shortcode and not the page title/breadcrumb option? When I select “Hide both” in the page settings, the shortcode breadcrumb disappears as well.
2. How can I make the shortcode breadcrumb full width?
3. Is it possible to remove the background color and line of only the shortcode breadcrumb?
4. In the page option I can toggle between using only the title or breadcrumbs. Is there a way to do this with the shortcode breadcrumbs as well?If this is to much custom work, never mind, then I would love to request this feature :D
Sincerely,
BarbAugust 26, 2015 at 1:33 pm #493533Hi!
1- Please turn on custom CSS field for ALB elements – kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/
and give your text block or code block element in which you add shortcode a custom class and add following code to Quick CSS.your-custom-class .main-title.entry-title { display: none !important; }
2- Please insert your shortcode into a color section element with a unique ID – http://kriesi.at/documentation/enfold/wp-content/uploads/sites/2/2013/12/color-section-ID.png and add following code to Quick CSS
#your-custom-id .container { max-width: 100% !important; width: 100% !important; padding: 0; margin: 0; }
3- Please see #1 and add custom class and then add following code to Quick CSS
.your-custom-class .title_container { background: transparent !important; }
4- Using custom CSS code and custom classes you can adjust it as #1 :)
Cheers!
YigitSeptember 3, 2015 at 2:35 pm #497647Hey Yigit,
Thx for all the tips! I wanted to answer you after I tried everything in your message, but I did not have the time yet.
I’ll get back to you.
Sincerely,
BarbSeptember 3, 2015 at 2:44 pm #497654 -
AuthorPosts
- You must be logged in to reply to this topic.