Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #21458


    What would I need to change to have 4 or more lines of text below a portfolio thumbnail on the overview page? Right now enters or hard enters don’t work, it just places the text after each other instead of going to the next line.

    I added an image for you to better understand what I’m asking.




    You would need to create some custom fields and attach them to the portfolio cpt so that they appear on add/edit portfolio item. Then on the portfolio archive you need to display their values.

    I made the first part for you. See post below yours.




    Hi Nick,

    I added the pastebin code to functions.php. I then added the 2 extra lines to /include/loop-portfolio.php, not -items because I dont have that file.

    That didn’t work, so I created a .php file with just those 2 lines of code and named it loop-portfolio-item.php and uploaded it into /includes.

    That also doesn’t work.

    It gives me the extra “port-box” field, and the ‘click here to add name and extra lines’, but when I enter tekst and publish the item, it’s not displayed below the portfolio thumbnail unfortunately.



    Ok lets redo, the way i wanted it originally won’t work. So remove the stuff from functions.php that you previously added (everything after line 213) and in its place add this to the end of functions.php —>

    Now you will get the same 2 fields in portfolio items. In the second field, just add your lines of text (into the same textbox) but separate each line by


    So that it would look like this (ignore the /br or br/ .. my mistake, in html5 , br by itself with no slashes is appropriate)

    Now in /include/loop-portfolio.php remove the previous 2 lines and instead find line 49 which looks like

    echo "</a></h1>";

    delete line 49, and in it’s place paste these two lines below.

    echo "</a> ( ".get_post_meta($post->ID, 'nick_empname', true)." )</h1>";
    echo get_post_meta($post->ID, 'nick_empline', true);

    I tested it and works fine. Just needs some styling.




    Thanks Nick,

    that worked great!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Multiple lines of text on portfolio tiles / thumbnails’ is closed to new replies.