Grow your CSS skills. Land your dream job.

Can I adjust this portfolio viewer?

  • # December 21, 2012 at 5:02 pm

    hey there! I would greatly appreciate some feedback advice. I have built a website based on this wordpress template.. Check out the portfolio section and how you are able to filter the different kind of portfolio pieces. http://hanna-wp.firstbasedesign.co.uk/

    So on the back end of WordPress you make portfolio pieces that are similar to WP posts, but they are called projects.. this is new to me as I havent been on WP in a year or so. So in the portfolio back in area you have this list that you can order the portfolio projects.

    THIS is what I want to know, and bare with me as I try to explain. when you come to the home page and go to portfolio, it defaults to showing ALL projects and it shows the top 6 (or however many you choose 16 being max) projects from that list you set up on the back end of wp. So if I click on illustration, it only shows the illustration projects WITHIN that top 6.. but I would LOVE if it would go on down past the top 6 in the list and show 6 illustration projects.. not just the 3 or however many that are in the top 6 . does that make sense?

    I am wondering if I am missing something within the WP setting OR if I can hack into the PHP or Jquery (not sure what is is as Im mostly an HTML CSS girl) and force it to do this??

    # December 21, 2012 at 5:06 pm

    So say my top 6 is 3 illustration projects 2 audio production projects and 1 web design project. when I click on illustration in the filter just those three illustrations in the top 6 show.. well not only do I want those to show, I would love if it would fill in those remaining 3 with illustration projects I have lined up below the top 6.

    # December 21, 2012 at 5:43 pm

    So basically you always want there to be 6 objects present at all times for each category.

    You could use AJAX to run a query that pulls in 6 of the posts that match the category/tag you want.

    Can you show some of the code you’re using to output the listings at the moment.

    # December 21, 2012 at 6:45 pm

    This is a section that as far as my eyes can tell pertains to the portfolio section.. some of this seems to repeat over and over and I couldnt paste it all.

    < ?php if($data["text_portfolio_title"]){ ?>

    < ?php echo $data; ?>

    < ?php } ?>

    < ?php if($data["filterable_portfolio"]){ ?>

    < ?php } ?>

    < ?php
    query_posts(array(
    ‘post_type’ => ‘portfolio’,
    ‘orderby’ => ‘menu_order’,
    ‘order’ => ‘ASC’,
    ‘posts_per_page’ => $data
    ));
    ?>

    < ?php
    $title = get_the_title();
    if ($title == “1 Column Portfolio”) $data = “1 Column Portfolio”;
    if ($title == “2 Column Portfolio”) $data = “2 Column Portfolio”;
    if ($title == “3 Column Portfolio”) $data = “3 Column Portfolio”;
    if ($title == “4 Column Portfolio”) $data = “4 Column Portfolio”;
    ?>

    < ?php if ($data == "1 Column Portfolio") { ?>
    < ?php $i=1; ?>
    < ?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    < ?php
    $terms = get_the_terms( $post->ID, ‘project-type’ );
    $term_list = ”;
    if( is_array($terms) ) {
    foreach( $terms as $term ) {
    $term_list .= urldecode($term->slug);
    $term_list .= ‘ ‘;
    }
    }
    ?>

    id=”post-< ?php the_ID(); ?>“>

    # December 24, 2012 at 6:41 am

    Anyone?

    # December 24, 2012 at 8:59 am

    @LinCSS25 Let me understand this. The Portfolio page only shows six pieces at once from all of your projects (illustration, audio, web design, etc). When you click on a specific category of the portfolio, it only shows three. However, you want it to show six instead, correct?

    # December 27, 2012 at 10:59 pm

    Yes! it allows me to upload on the back end.. as many as I want.. but it only shows the top 6.. so if there is only 2 illustration tagged in that top six it only shows those 2.. Id like it to go further down the long list to fill in the rest with more illustration pieces.

    Thanks!

    # December 27, 2012 at 11:09 pm

    The solution to this is probably to AJAX a new query_posts on the different categories. If it’s only loading 6 on the first run through it will need to fetch more when you change the category. Ajax is probably the least annoying way to do this, from a visitor perspective.

    # December 27, 2012 at 11:14 pm

    Thanks. Yikes… I know nothing about AJAX.. Is this not something I should attempt myself or do you have a link or something that can show me how so I can take a stab?

    I appreciate your help

    # December 27, 2012 at 11:18 pm

    This is probably the best place to start, tech up top, examples down below. http://api.jquery.com/jQuery.ajax/

    # December 28, 2012 at 11:12 am

    Thanks. I think this is way over my head however :(

    # December 28, 2012 at 5:04 pm

    Ajax isn’t too complicated, think of it like a contact form mailer.

    You’re basically running a PHP file on demand without leaving the current page, Javascript takes the data, sends it to the PHP file and then loads in the results (in very rudimentary terms).

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".