0

I have this line of code

<?php if ( current_theme_supports( 'breadcrumb-trail' ) ) breadcrumb_trail( array( 'container' => 'nav', 'separator' => '>', 'before' => __( 'You are here:', 'chun' ) ) ); ?>

How do I insert the following code to replace the 'You are here' part?

 <a href="http://myblog.com"><img src="http://myblog/img/mini-gek.gif" alt="Home" title="Home"></a>             
        <span class="issue-num">The Itinerant &nbsp;&nbsp; | &nbsp;&nbsp;<?php echo do_shortcode("[issuem_issue_title]"); ?>
                </span>

I'm unsure how to break it up correctly.

2
  • 1
    You are using a framework. Which one? Commented May 28, 2014 at 8:02
  • He is using wordpress Commented May 28, 2014 at 8:14

3 Answers 3

3
<?php if ( current_theme_supports( 'breadcrumb-trail' ) ) breadcrumb_trail( array( 'container' => 'nav', 'separator' => '>', 'before' => __( ' <a href="http://myblog.com"><img src="http://myblog/img/mini-gek.gif" alt="Home" title="Home"></a>             
    <span class="issue-num">The Itinerant &nbsp;&nbsp; | &nbsp;&nbsp;'.do_shortcode("[issuem_issue_title]").'
            </span>', 'chun' ) ) ); ?>

Is this maybe what you ment?

Sign up to request clarification or add additional context in comments.

Comments

1

This should work:

<?php if ( current_theme_supports( 'breadcrumb-trail' ) ) breadcrumb_trail( array( 'container' => 'nav', 'separator' => '>', 'before' => '<a href="http://myblog.com"><img src="http://myblog/img/mini-gek.gif" alt="Home" title="Home"></a>             
<span class="issue-num">The Itinerant &nbsp;&nbsp; | &nbsp;&nbsp;'  .do_shortcode("[issuem_issue_title]") .'</span>'
 )); ?>

Comments

0

Simply add a variable to hold the text you want replaced ... like this:

$some_value = do_shortcode("[issuem_issue_title]"); 

$replace_with = <<< some_placeholder
<a href="http://myblog.com"><img src="http://myblog/img/mini-gek.gif" alt="Home" title="Home"></a>             
        <span class="issue-num">The Itinerant &nbsp;&nbsp; | &nbsp;&nbsp;$some_value
                </span>
some_placeholder;

And then use that variable instead of the phrase You are here

<?php if ( current_theme_supports( 'breadcrumb-trail' ) ) breadcrumb_trail( array( 'container' => 'nav', 'separator' => '>', 'before' => __( $replace_with, 'chun' ) ) ); ?>

Edit: just realized that I had php code inside the text, so I moved it outside to yet another variable.

2 Comments

It's good but a bit convoluted. I'm saving this to be used elsewhere though, thank you.
@demonboy glad to be of service somehow, and thanks to your comment I realized that I had php code inside the text area, so I moved it outside so it would at least run. So thank you also

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.