Support » Plugins and Hacks » Hacks » Can't Echo a Link Properly to a Custom Post Type

  • Resolved zoaCode

    (@colorgazelle)


    This is the code I am working with:

    echo '<a href="' . bloginfo('template_directory') . $slug['slug'] . '">' . $post_type->labels->singular_name . '</a>' .$markup;

    I am trying to create a link to a slug named “Portfolio”. It links to a page in the template directory not the blog directory. The above code does this but displays the entire URL string before the link in regular normal text. How may I hide the URL path properly?

    Exact example: http://www.blah.com/blah/blahPortfolio
    Where: `http://www.blah.com/blah/blah needs to be hidden.

Viewing 1 replies (of 1 total)
  • zoaCode

    (@colorgazelle)

    I solved this myself with:

    echo '<a href="' . $slug['slug'] . '">' . $post_type->labels->singular_name . '</a>' .$markup;

    I have several blogs installed on the same domain and that was causing the problem. Just when you think you know everything …:)

Viewing 1 replies (of 1 total)
  • The topic ‘Can't Echo a Link Properly to a Custom Post Type’ is closed to new replies.