The WordPress community currently has more than 23000 plug-ins that perform a large number of tasks. We will show you three high-quality free plug-ins to help you launch a well configured portfolio. TL; If you scan Dr articles here, the list of plug-ins I mentioned is as follows: the custom post type UI metabox post 2 post topic source code. Now, in most cases, these plug-ins need to know how to use the word press API. The custom post type UI creates custom post types and classifications. Meta box creates a simpler metabox API. Post2 Posts creates relationships between post types. The
You can create your own word press plug-in. Why do you use the plug-in to perform these operations? In order to remove heavy objects. If you are like me, you will find it boring to build dozens or hundreds of word press themes and continue to rewrite the same code. The toolkit requires a start time when creating themes, and provides a lot of functionality from the beginning, so you can focus on what really matters is customization. The final product below is a screenshot of a simulated portfolio of products to make these excellent plug-ins. Male plug-ins each plug-in will provide you with a brief overview of what you can do and how to work together. If you already know the code, move the code page down. The
User defined post type UI malecpt is a fantastic plug-in that can easily generate user-defined post types and categories. Of course, you can do this from scratch with code that uses the custom post types API and the taxonomy API, but CPT uses a clean UI to enter all the information required for each post type. After you enter the settings, you can put them directly into the import code topic. I like this because I don’t rely on databases to keep plug-ins or custom post types working. The
Metabox malemeta box is always useful when creating custom word press themes. The add_meta_box() function makes setting up relatively easy. However, it can be boring when dealing with image uploads, color selection, and advanced input. Meta box provides a variety of inputs and can be used with a much simpler API than the one provided by word press by default. Again, define the meta box through the code. The plug-in provides extended functionality for advanced input. Unless it is provided by the default in the post 2 post androg WordPress, there is one thing about the article type relationship. Posts 2 Posts allows you to connect post types with one line of code. The plug-in will automatically connect by adding a meta box to the editor page. This is very convenient for connecting people to projects, connecting projects to clients, and so on. The
All of this is now integrated, and I get lower information about my power kit. Now is the time for practical use. We will build a fully functional portfolio theme in an hour to show how simple it is. Note: This article is not about portfolio design, but about functionality, so I only show the minimum CSS. The information architecture plan is very simple. Let’s make a plan for how the content is composed. For our purposes, take a look at the fake design agent creator. Creator came to us for the WordPress portfolio. The portfolio has one item, a content type. There may be teams working on projects in the portfolio. It also has ex post relationships with other content types. Finally, creator has multiple offices, each
The office has many team members who belong to the office. Therefore, the relationship with the post type is as follows: The
There are many team members in the office. Team members have many projects. The project has many team members. The project has an office through team members. Overview of post relationship each post type requires a different meta box set. Each user-defined field is listed below. Office location picture (thumbnail) team member role age education picture (thumbnail) project client budget multiple pictures! Start with a new word press installation. If you don’t know the method, WordPress. Follow the tutorials on www.org. The following is a quick table of contents that you can easily refer to: The
Create a post type create a post type relationship create a meta box add heap content add a page to display content add an office page create a team list create a team member profile page with an office profile project list create a project list page create a project list page create a single project page create the next plug-in , install, and activate. Custom post type UI metabox post 2 post maleonce installed, 3 new APIs and new settings pages will appear. Good! Now it’s time to immerse yourself in some code. The types of posts are very large. Therefore, you must create offices, team members, and projects. Hover over the new settings menu displayed in the sidebar named custom post type, and then click add new. The
Here is an opportunity to create a custom post type or category. Now let’s be faithful to CPT. Please continue to enter simple settings for the post type. For office, the post type name must be ‘office’. The label must be \
Note: since \
The function of tweenttwelve. To keep PHP simple, all the code written in this article is a function of twentytwelve. Place it at the top of the PHP file. Open in your favorite text editor. Open \
‘description’= [1jeemaa1]’ ‘,
‘public’= > true,
‘show_ui’= > true,
‘show_in\menu’= > true,
‘capability_type’= >’post’,
‘hierarchical’= > false,
‘rewrite’= > array (‘slug’ = [1jeemaa1] ”,
‘query_var’= > true,
‘exclude_from
Array(
‘name’= >’budget’,
‘id’= > $prefix.’ Budget’,
‘desc’= >’Please enter the budget for this Project’,
‘type’= >’text’
),
Array(
‘name’= >’project images’,
‘id’= > $prefix.’ Proj_images’,
‘desc’= >’upload and reorder as many images as you wish!’,
‘type’= >’image’
),
)The
);
And
}And Of course, it also provides all the functions of uploading images, which can be uploaded and reordered. When you are dealing with a clumsy client, this feature is very convenient and can easily be bothered by the simplest tasks. Male full! Now that all the custom post types, post relationships, and meta boxes have been completed, you can finally add some fake content to the assortment. If I can’t trouble you, I’m lucky to get my fake product portfolio out. Unfortunately, some images need to be uploaded directly. Top down content our content structure is a top-level content project. There are offices. Each office has many members, and each member belongs to many projects. First, we will create two offices: \
Male’offices’);? >
Have_posts()):? >
Male
Male have_posts()): $offices_query->the_post(
);? >
Male
Male
And
From here we can know something. First, we started a new wp_query object, which specifies that we only want posts with a post type of \
Male
Male
Male male
Male ID,’p_location’, true);? > Male
Male
Male
Male \
Male
Male ID,’p_location’, true);? > Male
Male
Male
Male male
And Then visit the office page and you will see: The office profile page is now in place, and you can use a single office profile to dirty your hands. Here, you will list all team members working in a specific office. Content office PHP is recyclable, but you must create a new template file for a single office. Single Copy PHP and name it single offices. PHP single Replace with PHP. Delete lines 19-25. This will delete browsing posts and comment templates. Very simply, we will show all the team members associated with each office. Post2 Posts contains a function that adds relational data through the $post variable by calling before the loop. While (have_posts()) add the following before the condition: Male each_connected ($wp_query, array(),’people’);? > After the function is decomposed, the p2p_type() function of the returned object accepts the relationship name parameter. Remember when we first defined relationships? The names are office_to_people and people_to_projects. Use here. The returned \
Male
Male
In between, you can repeat $post->people and easily display team members. We want a small thumbnail and name, which must be linked to its own profile page. Add the following code to the new condition you just created: The team
Male
Male people as $person):? >
Male
Male ID);? > \
Male ID, array (1
00100));? > Male
Male post_title;? >
Male
Male
Male
Male
Here’s the team name Then there is the list of team members to include. We repeat that $post->people provides the post object. Others are standard word press, which creates a link to a single page and spits out the thumbnail and name of the post. Return to the browser and on the office page, click office. Here is something you want to see! Add some CSS to make it look better. Style Open CSS and paste the following after resetting the style (around line 178):\/**= Custom CSS
————————————————————–The*\/
Single H2{
Margin bottom: 10px;
}The
Single List of thumbs Li{
Display: inline block;
Margin right: 20px;
Margin left: 0;
Text align: center;
List style: none;
}The
Single List of thumbs Li img{
Margin bottom: 5px;
}The
Single List of thumbs Li a{
Text decoration: none;
}Refresh displays a cleaner page. The members’ Avatar page is amazing! Now that you have completed a single office page, you can start working from a single user page. Single Re copy PHP and name it single-peer. Change PHP. Delete lines 19-25 again, and delete comments and post navigation. To display the list of related posts, we follow the same method as the office_to_people relationship, and only use people_to_projects. Continue to be single -people Add the p2p_type function in front of the while (have_posts()) function in PHP. Male each_connected ($wp_query, array(),’projects’);? > In addition, a new \
Male male
Male ID,’p_role’, true);? > Male
Male ID,’p_age’, true);? > Years old male
Education
Male
Male ID,’p_education’, true);? >
Male
Male male male
Male
Male
Male
Male is now a human related project. The project has been previously added to the post variable, which means it can be used in the $post-> project. Single person In PHP, find the entry content div and fill in the following: Male projects malehas worked on
Male
Male projects as $project):? >
Male
Male ID);? > \
Male ID, array (100100));? > Male
Male post_title;? >
Male
Male
Male
This is almost the same as showing the office page of team members. We use the same UL class \
To make the gold look more beautiful, we will add some CSS. Customize CSS to style. Return to the location in CSS and add the following: Single people WP post image Single projects WP post image{
Width: 150px;
Float: left;
Margin right: 20px;
}The
Single About{
Float: left;
Width: 300px
}The
Single About P{
Margin: 10px 0;
}The
Single About Li{
List style: disc;
List style position: inside;
}The
Single people List of thumbs{
Clear: both;
}The
Single people List of thumbs*{
Width: 100px;
}Selector for has been added. Single project. WP post image Similar selectors are provided on a single profile page, so you can reuse the layout by default without adding additional code. Refresh or move to a person page through the office page, click! All items are listed under a nice, clean profile. The last important point of the project list page is that we will create a quick project page to list all project images (uploaded using the meta box we easily created) and designed offices. We do two things here. First, get the list of uploaded images and related posts at a higher level than project related posts. This is a reverse overlap (on the tree) or, more eloquently, a relationship established through the post type. However, you must first create an item list page. Duplicate page -office. PHP, rename page projoects. PHP Open it, replace all instances of \
Have_posts()):? >
Male
Male have_posts()): $projects_query->the_post();? >
Male
Male then visit the items page to view a list of all items. Male but very satisfied at present -office. Because there seems to be no PHP, content office. Copy PHP and name it content project. Change PHP. We want to keep this page as an image, title, and description. Now it is content project. PHP is almost here. However, for the project, we moved the_post_thumbnail() on line 27 to line 17 directly above the project title Div. Entry content div moves the male mark forward directly. To display the client and budget customization methods, replace the two instances of get_post\u meta(), as follows: Male ID,’p_client’, true);? > Male
Male budget: maleid,’p_budget’, true);? > Male followed by custom. Add the following CSS to the CSS custom style: Page Type projects{
Min height: 150px
}The
Type projects WP post image{
Width: 150px;
Margin right: 20px;
Margin bottom: 20px;
Float: left;
}The
Type projects Entry header{
Display: inline block;
Float: left;
Width: 300px;
}If all goes well, now there is a wonderful project page. The single item page ends with a single item
Office link{
Margin bottom: 10px;
}The
Project images{
Clear: both;
}Finally, the final project page must be as follows: That’s all! If you pass it all, thank you. I discussed how to use three excellent plug-ins to start a well configured product portfolio by using user-defined post types, user-defined categories, user-defined meta boxes, and content relationships. Although WordPress has a default API, most of these components simplify the process and complete tasks quickly. Needless to say, they are all code based solutions. In order to maintain consistency, you don’t have to worry about database dependencies between site instances. With this tool, you can create a wonderful product portfolio in an instant! As a reference for ing the source code, I compressed the topic. Compare your code with this freedom! Labels: Custom article types