Community Forums › Forums › Archived Forums › Design Tips and Tricks › titles not showing on portfolio
- This topic has 30 replies, 2 voices, and was last updated 10 years ago by jbergen.
-
AuthorPosts
-
September 8, 2014 at 5:20 pm #123497ianmattMember
My titles are not showing on the portfolio archive page. Also wondering if I can change the two columns to 3 and if I can change the page from PORTFOLIO to SERVICES.
http://www.daydreamit.com/dev/milpond-2/portfolio/September 8, 2014 at 9:49 pm #123508jbergenMemberHi,
The titles are currently hidden by this rule in style.css, line 803:
.entry-title { font-size: 30px; line-height: 1; display: none; }
You can show them by removing the
display:none;
line.This tutorial shows how to change from a two-column grid to a three-column grid.
I'm not sure about changing Portfolio to Services because I'm not sure which theme you're using. You might want to post that specific question again and mention which theme it is.
Jamie
Jamie @ Ladebug Studios
September 8, 2014 at 10:04 pm #123510ianmattMemberThanks so much Jamie. I am using the Minimum Pro theme. Does that tutorial work for my theme too? As far as the titles. I wonder what is the best way to have them display ONLY on the portfolio page.
September 8, 2014 at 10:07 pm #123511ianmattMemberone other thing how do I get the portfolio page to display all of my portfolios and not have the pagination at bottom?
September 9, 2014 at 9:10 am #123582jbergenMemberHi!
I took a look at your theme and found the part of style.css that will make the portfolio 3 columns. All you need to do is replace the portion of style.css from lines 1252 to 1266 with this:
.post-type-archive-portfolio .entry { float: left; margin-right: 5.263157894737%; width: 29.824561403509%; } .post-type-archive-portfolio .entry:nth-of-type(3n+3) { margin-right: 0; } .post-type-archive-portfolio .entry:nth-of-type(3n+1) { clear: left; }
That will give you this:
I'll get to your other questions shortly.
Jamie
Jamie @ Ladebug Studios
September 9, 2014 at 10:41 am #123598jbergenMemberHere's some more info:
1) Display titles ONLY on the portfolio page:
You can change style.css, line 803 back to
display: none;
:.entry-title { font-size: 30px; line-height: 1; display: none; }
And then you can write a more specific instruction to display entry titles only on the portfolio page:
.post-type-archive-portfolio .entry-title { display: block; }
2) Display all of my portfolios (no pagination):
The number of portfolio items that are displayed per page is set in functions.php. I've copied the code below. All you need to do is change
$query->set('posts_per_page', '6');
to$query->set( 'posts_per_page', '12' );
. I changed it to 12, but you can use any number that's equal to or greater than your current # of portfolio posts. It will look like this://* Change the number of portfolio items to be displayed (props Bill Erickson) add_action( 'pre_get_posts', 'minimum_portfolio_items' ); function minimum_portfolio_items( $query ) { if ( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) { $query->set( 'posts_per_page', '12' ); } }
3) Change the page from PORTFOLIO to SERVICES:
The reason it's called PORTFOLIO is because that's how it's defined as a custom post type in functions.php. You could replace "portfolio" with "services" in functions.php as shown below. However, be aware that you'll lose your current portfolio posts. Also be aware that if you make these changes, you'll lose everything if you ever update your theme.
//* Create services custom post type add_action( 'init', 'minimum_services_post_type' ); function minimum_services_post_type() { register_post_type( 'services', array( 'labels' => array( 'name' => __( 'Services', 'minimum' ), 'singular_name' => __( 'Services', 'minimum' ), ), 'exclude_from_search' => true, 'has_archive' => true, 'hierarchical' => true, 'menu_icon' => 'dashicons-admin-page', 'public' => true, 'rewrite' => array( 'slug' => 'services', 'with_front' => false ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes', 'genesis-seo' ), ) ); }
and:
//* Change the number of services items to be displayed (props Bill Erickson) add_action( 'pre_get_posts', 'minimum_services_items' ); function minimum_services_items( $query ) { if ( $query->is_main_query() && !is_admin() && is_post_type_archive( 'services' ) ) { $query->set( 'posts_per_page', '12' ); } }
I hope that helps!
Jamie
Jamie @ Ladebug Studios
September 9, 2014 at 3:01 pm #123640ianmattMemberJamie thank you SOOOOO much this is awesome. The ONE thing I am totally stuck on is if I change PORTFOLIO to SERVICES I won't be able to update the child theme and I will loose all the current posts. Would you be able to advise me on a different solution perhaps? I basically need to ability to display several different portfolio pages. I assume this will work by using portfolio categories. Thoughts?
September 9, 2014 at 4:18 pm #123653jbergenMemberHappy to help! I think your best bet for having multiple different "portfolio" pages is to use categories, as you said. And I think this tutorial (the same one as before) will actually help with this. Basically, you'll use normal posts (instead of the Portfolio custom post type) and assign them to different categories. Then you can create separate pages to display each category.
Let me know if that's what you're looking for. (And you'll still want to save copies of all of the files you add or change in the theme just in case you ever want to update the theme.)
Jamie
Jamie @ Ladebug Studios
September 9, 2014 at 4:53 pm #123659ianmattMembercool thank you i will review the tutorial and go from there. Would using that method prevent me from being able to implement a type of category sorting in the future?
September 9, 2014 at 5:35 pm #123665jbergenMemberI'm not exactly sure what you mean by category sorting, but I suppose if you wanted to have a blog on your site, then you might want to exclude those specific post categories (e.g., services, etc.). But that type of thing is definitely possible.
Jamie
Jamie @ Ladebug Studios
September 9, 2014 at 9:30 pm #123681ianmattMemberHI jamie, wondering if you could check something out. I followed the tutorial but am seeing a few problems. My custom page templates are not showing up as options when i create a new page. One of my page templates is names category-services.php The other is category-success.php , I posted a blog post in the new catagory services. If you got to this page in th url bar you can see the post on the page but it is not displaying the featured image. http://www.daydreamit.com/dev/milpond-2/services/
Any idea what I am doing wrong? thanksSeptember 10, 2014 at 9:15 am #123743jbergenMemberYou won't see your custom page templates as options when you create a new page or menu item. They're basically generated automatically when someone goes to the url: yoursite.com/category/slug (assuming your category template was called category-slug.php). So basically you'll just make the category template, write posts that are assigned to that category, and then make that a menu option by going to Appearance -> Menus and selecting Categories (on the left below Pages and Links). Then you'll have a menu option that displays the custom category template for that category.
If you want, you can paste the category-services.php template you wrote and I can see why you're not seeing the featured image.
Jamie
Jamie @ Ladebug Studios
September 10, 2014 at 9:21 am #123744ianmattMemberHi Jamie thank you. so last night I followed this tutorial to the T. I still am not getting it to work. Would it be easier for you to be able to login to my site and see what I have set up? I cant figure out why my service page is reading services-3 in the url...
http://www.daydreamit.com/dev/milpond-2/services-3/September 10, 2014 at 9:58 am #123749jbergenMemberThis reply has been marked as private.September 10, 2014 at 10:01 am #123751ianmattMemberHi jamie so I think everything is working fine however the one thing that is really getting me bad is having the word portfolio in the URL. You mentioned updating my them would kill all my posts in the future, how would you treat this?
September 10, 2014 at 10:33 am #123759ianmattMemberI dont know how to view the private reply you posted
September 10, 2014 at 12:12 pm #123787ianmattMemberJust one other thing, now that I have the post types working I have lost my 3rd row and the titles are gone for each posting page.
September 10, 2014 at 1:13 pm #123800jbergenMemberTo add the third row for your new page templates as you did for the portfolio page, you'll need this CSS:
.tax-portfolio-type .entry { float: left; margin-right: 5.263157894737%; width: 29.824561403509%; } .tax-portfolio-type .entry:nth-of-type(3n+3) { margin-right: 0; } .tax-portfolio-type .entry:nth-of-type(3n+1) { clear: left; }
As far as getting rid of the word "portfolio", it shouldn't show up anywhere if you're making regular posts (not portfolio entries) with assigned categories and writing category templates. And if you do it that way, they should be safe whether or not you have that portfolio custom post type that comes with the theme.
As far as showing the titles, you can use CSS as I showed you before to display them specifically on that page.
Jamie
Jamie @ Ladebug Studios
September 10, 2014 at 1:21 pm #123801ianmattMemberThanks so much that worked for the 3 columns. I ended up following this tutorial that guided me through using the portfolio option. I think I may be too far along to go back to the regular posts option...? http://sridharkatakam.com/adding-portfolio-type-taxonomy-minimum-pro/
September 10, 2014 at 1:26 pm #123803ianmattMemberI have this css in place but it is now working for portfolio custom archive pages.
.entry-title {
font-size: 20px;
line-height: 1;
display: none
}.post-type-archive-portfolio .entry-title {
display: block;
}http://www.daydreamit.com/dev/milpond-2/portfolio-type/services/
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.