Will someone teach me why I cannot just change the a href to a hardcoded url link?

I want the page http://zanifesto.com/product/boise-infographic/ go back to http://zanifesto.com/gallery, not the Infographics category page at the “Back to” link at the top.

When I replace the .home_url etc etc you see below with the gallery url mentioned above, it errors out.

I am looking to understand why the php code doesn’t act like I am replacing one url for another.

<div class="product_navigation desktops">
            <?php
                $term_list = '';
                $j=0;
                foreach ($terms as $term) {
                    if($term->parent==0){
                        $j++;
                        if( $j <= 1 ){
                            $term_list .= '<a href="'.home_url() . '/' . $category_slug . '/'. $term->slug . '">' . $term->name . '</a>';
                        }
                    }
                }
                if(strlen($term_list) > 0){ echo '<div class="nav-back">‹   '. __('Back to ', 'theretailer').$term_list.'</div>'; };
            ?>
            <?php if (function_exists('be_previous_post_link')) { ?>
            <div class="nav-next-single"><?php be_next_post_link( '%link', '', true,'', 'product_cat' ); ?></div>
            <div class="nav-previous-single"><?php be_previous_post_link( '%link', '', true,'', 'product_cat' ); ?></div>
            <div class="nav-prev-next-txt"><?php _e('Prev / Next', 'theretailer'); ?></div>
            <?php } ?>
            <div class="clr"></div>
        </div>
        <?php } ?>

Read more here: Will someone teach me why I cannot just change the a href to a hardcoded url link?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: