Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #552532

    So I have been trying to get the breadcrumbs short code to work and cant seem to get it going. This is what im doing. Using a child theme I

    I take this code

    //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'] = "";
    		}
    		
    		
    		// Parse incomming $args into an array and merge it with $defaults
    		$args = wp_parse_args( $args, $defaults );
    		$args = apply_filters('avf_title_args', $args, $id);
    
    		//disable breadcrumb if requested
    		if($header_settings['header_title_bar'] == 'title_bar') $args['breadcrumb'] = false;
    		
    		//disable title if requested
    		if($header_settings['header_title_bar'] == 'breadcrumbs_only') $args['title'] = '';
    
    		// OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
    		extract( $args, EXTR_SKIP );
    
    		if(empty($title)) $class .= " empty_title ";
            $markup = avia_markup_helper(array('context' => 'avia_title','echo'=>false));
    		if(!empty($link) && !empty($title)) $title = "<a href='".$link."' rel='bookmark' title='".__('Permanent Link:','avia_framework')." ".esc_attr( $title )."' $markup>".$title."</a>";
    		if(!empty($subtitle)) $additions .= "<div class='title_meta meta-color'>".wpautop($subtitle)."</div>";
    		if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
    
    		$html = str_replace('{class}', $class, $html);
    		$html = str_replace('{title}', $title, $html);
    		$html = str_replace('{additions}', $additions, $html);
    		$html = str_replace('{heading}', $heading, $html);
    
    		if(!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview())
    		{
    			$avia_config['small_title'] = $title;
    		}
    		else
    		{
    			return $html;
    		}
    	}
    }
    

    Add it to my child theme functions.php file

    I make a copy of the template-builder.php and put it in my child theme and comment out like 19 //

    I add the shortcode code at the bottom of the function i copied over to my function file

    add_shortcode( 'bread_crumb', 'avia_title' );

    then add the shortcode in a page to test but this does not work at all.

    Any help would be great.

    #552636

    Hey acscreativenew!

    http://kriesi.at/documentation/enfold/inserting-breadcrumbs-as-shortcode/

    Give a better look here please. That is the proper method to use it out.

    Tanks a lot

    Best regards,
    Basilis

    #553182

    so yea I did, i don’t think i missed any steps but still not working?

    #553265

    So I the problem i’m running into is that it shows up twice now. When I have it set in the settings to show in the Enfold settings it shows up two times. When I turn it off both of them go away.

    #553296

    Hi!

    Can you please give us access to your web site?

    Best regards,
    Basilis

    #553298

    So what i’m trying to do just to give you some background. I’m trying to to create the title and breadcrumb shortcode so I can add it myself to the header.php. I want to do this so I can wrap that in a custom div and call different background for each page via a ACF field that I will create. I am trying to use

    <?php echo do_shortcode( '[bread_crumb]' ); ?>

    in my header file along with the other instructions found on using the breadcrumbs shortcode but am having no luck

    Thanks

    #556084

    Hi!

    it would require a huge amount of time and customization of the theme and that is why you would need to hire a freelance developer for this job.

    Regards,
    Andy

    #556087

    Hi, So I honestly don’t think it would require a lot of customization It would really only require me getting that bread crumbs shortcode working, and thats what im having trouble with. I can’t seem to get it too work so If you could just help me get that working that would be all I needed. Please let me know what you need from me to get that working.

    Thanks
    -Dan

    #558919

    Hi!

    Your trying to turn the breadcrumbs into a shortcode? You can try this, https://kriesi.at/support/topic/transparent-header-layout-issues/#post-544853, it worked for another user.

    Regards,
    Elliott

    • This reply was modified 8 years, 11 months ago by Elliott.
    #560554

    Hello,
    I am using Enfold with Main Menu as sidebar left (no top header, as in the demo Enfold Photography Portfolio). Now I’d like to insert breadcrumbs to some post/pages. I tried
    http://kriesi.at/documentation/enfold/inserting-breadcrumbs-as-shortcode/
    but it didn’t work. Maybe to me – as a beginner – the description is not clear enough:
    1. “… add following code right after closing of ‘//advanced title + breadcrumb function’ function” -> where exactly should I add the code?
    2. Where exactly do I place the [bread_crumb] shortcode to my page/post/portfolio page? Into a colour section? Within a code block element?
    Hm. Sorry about being so confused.
    Maybe I can get some help here?
    Thanks, Ursula

    #561015

    Hi @bume216,

    Please send us a temporary admin login so that we can have a closer look. You might want to start a new thread since the original poster will be able to see your details otherwise.

    Regards,
    Rikard

    #561120

    Hi Rikkard, please find the login below. Thanks, Ursula.

    #561295

    Hey!

    Breadcrumbs are disabled when side header is used. You can try using a plugin such as this one – https://wordpress.org/plugins/breadcrumb-navxt/

    Best regards,
    Yigit

    #698105

    In some cases you may not need to put an echo before the do_shortcode. The following code could be incorrect:
    <?php echo do_shortcode( '[bread_crumb]' ); ?>
    However, this works in some situations:
    <?php $variablename = do_shortcode( '[bread_crumb]' ); ?>

    • This reply was modified 8 years, 2 months ago by Michael.
    #698258

    Hi,


    @smartstartinc
    Thanks for your input! :)

    Best regards,
    Yigit

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