Add link to portfolio post title and also category under title

resolved (5 posts) (2 voices)

  1. Victorross
    Member

    Hi, please enter to my site:
    http://www.portalcorrientes.com/
    The home page is a portfolio, and i need that under the post image you can click the post title to go to the post, and also under the title i would like to show the category for the post.
    If you look http://www.portalcorrientes.com/empresa/ you can see the sidebar, so there is the post image, the post title with a link, and also the category with the link to the category archives.
    I think it is just a few php edit, not too complicated.
    Hope you can answer me soon.
    Thanks!

    Posted 1 year ago #
  2. Elliott
    Support

    Hello Victorross,

    This is possible but keep in mind that any changes we do will also effect your other portfolio's. If you still wish to proceed then open up `/wp-content/themes/infocus/lib/functions/shortcode.php and find line 138 which should look like this,

    $out .= '<h3>' .$portfolio_title. '</h3>';

    Go ahead and change it like this,

    $category_name = get_cat_name($cat); $out .= '<h3><a href = "'.$permalink.'">' .$portfolio_title. '</a></h3>'.$category_name;

    Posted 1 year ago #
  3. Victorross
    Member

    Hi Elliott! The title is ok, but the category shows the FIRST LEVEL CATEGORY, and not the subcategory that i choose for each post, and also do not ahve the link to the archives for that category.
    Thanks for the support!

    Posted 1 year ago #
  4. Elliott
    Support

    That would have to be considered custom work Victorross, it would be best to hire a freelancer to get this taken care of for you. Some good places to look are freelanceswitch.com and jobs.wordpress.net.

    Good Luck!

    Posted 1 year ago #
  5. Victorross
    Member

    Wow man i am really impressed by my self, i have never edit this kind of files, but i get what i need, there is not a lot of coding here.
    If someone else need this now i put the code:
    Replace this

    $out .= '<h3>' .$portfolio_title. '</h3>';

    for this

    $my_query = get_post($der_post->post_parent);
    $category = get_the_category($my_query->ID);
    $ID = $category[0]->cat_ID;
    $category_name = get_cat_name($ID); $out .= '<h3><a href = "'.$permalink.'">' .$portfolio_title. '</a></h3>'.$category_name;

    Doing this you will see the category name from your post, and not the parent category name.
    So if you make a portfolio with all your categories or with 2 or more subcategories, you will get the name of each category, and not the parent of both two.

    Posted 1 year ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme