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, 3 months ago by jbergen.
-
AuthorPosts
-
September 10, 2014 at 3:12 pm #123829ianmattMember
Hey Jamie check this out. I have the hover effect and the title are showing on the main portfolio archive BUT none of it is working on the custom portfolio archive pages. I'm sure this is an easy fix just not sure how. can you help? Here is both links.
http://www.daydreamit.com/dev/milpond-2/portfolio/
http://www.daydreamit.com/dev/milpond-2/portfolio-type/services/
September 10, 2014 at 3:35 pm #123832jbergenMemberAdding this to style.css will make your titles appear on your portfolio-type services page. You shouldn't have to add anything else for the hover effect to work.
.tax-portfolio-type .entry-title { display: block; }
Jamie
Jamie @ Ladebug Studios
September 10, 2014 at 4:15 pm #123836ianmattMemberThat totally worked thanks so much. any chance you might be able to see why the javascript is only working on the main portfolio post page and not the portfolio custom type pages? so confusing.
September 10, 2014 at 4:44 pm #123841ianmattMemberThis is the code added to the functions.php that is working fine for the portfolio archive page.
//* Enqueue portfolio image hover script
add_action( 'wp_enqueue_scripts', 'portfolio_image_hover_enqueue_script' );
function portfolio_image_hover_enqueue_script() {if ( !is_post_type_archive( 'portfolio' ) ) {
return;
}I have tried modifying this to make it work for the other portfolio type pages but its not working. What would be the proper php?
http://www.daydreamit.com/dev/milpond-2/portfolio-type/services/
September 11, 2014 at 9:40 am #123940ianmattMemberMorning Jamie, wondering if you got a chance to view both of those links and if you have any ideas. This small problem is driving me crazy. Thanks
hover working : http://www.daydreamit.com/dev/milpond-2/portfolio/
hover not working: http://www.daydreamit.com/dev/milpond-2/portfolio-type/services/
September 11, 2014 at 11:53 am #123975jbergenMemberHi!
From the JavaScript you posted, it looks like your function is designed to work only for the portfolio archive page, which seems to be exactly what is happening. For the "portfolio-type/services" page, it returns before executing. Could you just remove that conditional return statement? Or would that cause hover effects in undesirable places? If that's the case, you're going to have to add a conditional that allows it to work for your portfolio-type pages.
Jamie
Jamie @ Ladebug Studios
September 11, 2014 at 11:57 am #123977ianmattMemberAWESOME! Would you be able to help me with what the conditional should look like for SERVICES post type? I can then follow suite for the others. Where or what php page does the conditional go?
September 11, 2014 at 12:10 pm #123988ianmattMemberIs this what I am needing?
http://codex.wordpress.org/Function_Reference/wp_enqueue_scriptSeptember 11, 2014 at 12:22 pm #123992jbergenMemberAre you using taxonomies to display portfolio-type/services? If so, you'll use is_tax() for your conditional. See this reference.
Jamie
Jamie @ Ladebug Studios
September 11, 2014 at 12:46 pm #123994ianmattMemberI am not using taxonomies. I am using the post type plugin.
September 11, 2014 at 1:13 pm #123999jbergenMemberI'm not familiar with that plugin, but if they're post types, then maybe you can just replace
if ( !is_post_type_archive( ‘portfolio’ ) ) { return; }
with:
if ( !is_post_type_archive( ) ) { return; }
That way it should work on all pages that are post type archives.
Jamie
Jamie @ Ladebug Studios
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.