• Resolved lfer

    (@lfer)


    Hello people.
    I’m using this hardcode im my “Purity Theme” to call “Promotion-Slider” in my “single-portfolio.php” template:

    <?php echo do_shortcode(‘[promoslider category=”rings” width=”662px” height=”441px”]’); ?>

    But, it’s a jewelry site and I have others categories to show like necklaces, earrings, bracelets, etc. So, I can’t put just one category name in my hardcode. I need to put a variable to get the right images from category that users chosen, so my code looks like this example:

    <?php echo do_shortcode(‘[promoslider category=”GET_PROMO-SLIDER_CATEGORY” width=”662px” height=”441px”]’); ?>

    I’m not a programmer and don’t know how to do this. Could anyone show me a way to get the right categorry chosen by the user.

    Thanks a lot.

    Luis Fernando

    http://ww.wp.xz.cn/extend/plugins/promotion-slider/

    [ Please do not bump, it’s not permitted here. ]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Micah Wood

    (@woodent)

    @lfer,

    Here is some code that will pull the current category and display the appropriate slider:

    <?php
        if( is_category() ) {
        	    $catID = get_query_var('cat');
    	    $cat = get_category( $catID );
    	    $shortcode = '[promoslider category="'.$cat->slug.'" width="662px" height="441px"]';
    	    echo do_shortcode( $shortcode );
        }
    ?>
    Thread Starter lfer

    (@lfer)

    Hello Micah.
    Thank you very much for your help, but I can’t make it work yet. Look the page http://www.cicloweb.com.br/site_clientes/test_fe/produtos/ and try to click in “Rings” category to go to single portfolio page. No images are show.

    I create a user and password for you acess WP-Admin area. If you can help me I apreciate a lot. I sent the username and password for your e-mail.

    Thanks
    Luis Fernando

    Plugin Author Micah Wood

    (@woodent)

    @lfer,

    You are actually trying to link a specific post type to the promotion categories. The code I gave you above isn’t working because you aren’t actually on a category page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Promotion Slider] getting category variable in hard code’ is closed to new replies.