Hello
I have a portfolio page that is working the way I want in X theme. I would like to replicate the same functionality in Pro.
Here is the working page in X:
edgeephotography.com/portfolio
This is a thread that once helped getting that page working:
Here is the code I use in X:
/*replace custom portfolio item links*/
add_filter( 'post_type_link', 'x_remap_portfolio_permalink_to_project_link', 10, 4);
function x_remap_portfolio_permalink_to_project_link($post_link, $post, $leavename, $sample) {
if ('x-portfolio' == $post->post_type) {
$custom = get_post_custom($post->id);
if (isset($custom['_x_portfolio_project_link']) && $custom['_x_portfolio_project_link'][0]!='')
return $custom['_x_portfolio_project_link'][0];
}
return $post_link;
}
/*randomize portfolio images*/
function cmk_custom_order( $wp_query ) {
/* Get the post type from the query*/
if (isset($wp_query->query['post_type'])) {
$post_type = $wp_query->query['post_type'];
/*If Post type is Portfolio*/
if ( $post_type == 'x-portfolio') {
/* Set Order to Random*/
$wp_query->set('orderby', 'rand');
/* un-comment if not using random order */
//$wp_query->set('order', 'DESC');
}
}
}
/* Change Order settings before displaying the Postype*/
add_filter('pre_get_posts', 'cmk_custom_order');
/* change page titles */
function x_wp_title( $title ) {
if ( is_front_page() ) {
return trim( $title ) . get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' );
} elseif ( is_feed() ) {
return trim( $title ) . ' | RSS Feed';
} else {
return trim( $title ) . ' | ' . get_bloginfo( 'name' ) . ' | ' . get_bloginfo( 'description' );
}
}
add_filter( 'wp_title', 'x_wp_title' );
How do I get this same functionality in Pro?
Thank you!