We form a page of one work in the portfolio - a lesson 29

Today we'll talk about, how to make a separate page for one of the works in the portfolio, as the work may have a description. Besides, you can always use the template created in this lesson for further refinement.

To begin with, we need to slightly modify our grid and allow the user to switch to displaying the full view of the work.. Go to file archive-my_works.php and add the link code:

<a href=”‘.get_permalink($item->ID).’” class=”text-title”>’.$item->post_title.'</a>

Hollow code listing:

Function get_permalink($item->ID) inserted a link to a separate portfolio type post with ID, which is substituted in the record output loop. Here is what the link looks like:

Ссылка на отдельную работу в портфолио

To design the page of one work, we need to create a new file for the template and name it single-my_works.php. I made my template based on the previous template tmp-twocolumn.php. File single-my_works.php I rebuilt it quite thoroughly and organized it into one column. I offer you download my file, the changes that were made in the file we have already gone through before, so I suggest just copying the code from my template single-my_works.php в yours for further study.

It is important to see how the thumbnail image output is organized in full size.

I did some more styling in the css/style.css file to make our template look passable.. Let's add a new class.

Theme files for this lesson

zip wordpress theme archive


Buy WordPress hosting
WordPress tutor
Online tutoring services. List of courses I teach
  • Basic web design course;
  • Site layout;
  • General course on CMS WordPress and continuation of the course on template development;
  • Website development in PHP.
Read more on the page WordPress tutor
*/

Nikolaenko Maxim

Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Templates for WordPress
The best hosting in Ukraine
Stable hosting for Drupal