Using JH Portfolio is similar to for Wordpress handles querying etc. Essentially, there are two parts: querying for what you want and display the query results using the jh_portfolio functions.
All queries are done through the JH_Portfolio class, all the functions are then called through that instance.
E.g.
$entries = new JH_Portfolio('p=4');
$entries->get_id();Querying
The query can either be passed as a string:
$entries = new JH_Portfolio('cat=10&postps_per_page=7&paged=9');Or in an array
$entries = new JH_Portfolio( array(
'cat' => 10
'paged' => 9
) );Below are a list of possible query vars, along with their defaults
'showposts' => 10, //max num of returned posts
'category' => 0, //category ID
'category_name' => '', //category name
'orderby' => 'post_date', //any column to order by
'p' => '', //post_id for single queries
'post_name' => '' //post name, can be used with category if there are more than one with the same name
Display the Query
Once you have set up your query into a variable, all the 'template' functions are called through that. To show a list of all posts would be:
<?php
$entries = new JH_Portfolio('showposts=-1') //you must specify something for the query
if( $entries->is_posts() ) : while( $entries->have_posts() ) : //similar to wordpress loop
?>
<a href="<?php echo $entries->get_permalink() ?>"><?php echo $entries->get_title() ?></a><br />
<?php endwhile; endif ?>
?>Using the global $jh_portfolio
Similar to Wordpress, there is an instance of JH_Portfolio automatically set up bepending on the current page url. All the Template Tags are just shortcuts to the global $jh_portfolio instance. So:
echo jh_portfolio_get_permalink();
Will display the permalink of the current entry in the global $jh_portfolio instance of JH_Portfolio.
It is recommend to leave the $jh_portfolio global set to the current page's entry, and then any extra items, or portfolio lists you want to display on that page, set up new queries into other variable name, this means the main post for that page will not be lost or overwritten.