Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mat Lipe

    (@mat-lipe)

    HI maddogprod,

    Using
    [simple-links category=”test”]
    Will display the links for a category named test.

    Otherwise if you are trying to pull the category from somewhere else you could use a
    echo do_shortcode('[simple-links category="test"]');
    and enter the category on fly from your theme’s file.

    Hope this helps.

    Thread Starter maddogprod

    (@maddogprod)

    Thanks for the quick response. I’m trying to call the category on the fly along with the category page. Say I click a link that takes me to https://mysite.com/stories/category/f-257. I’d like to automatically display [simple-links category=”f-257″]….I know this isn’t correct, but since I’m using the slug, in effect something like [simple-links category=”$slug”] so it would automatically use the current category slug of that page.

    I hope I’m making sense.

    Plugin Author Mat Lipe

    (@mat-lipe)

    You could use something like

    $name = get_cat_name( get_query_var('cat');

    to get the name then run it like

    echo do_shortcode('[simple-links category="'.$name.'"]');

    Hope this helps.

    Plugin Author Mat Lipe

    (@mat-lipe)

    I missed a ) in the above example. It should be

    $name = get_cat_name( get_query_var('cat'));

    Thread Starter maddogprod

    (@maddogprod)

    Thanks. I wanted to make sure variables would work within the shortcode so that (or a similar version) should do the trick. I’ll let you know if I have any problems.

    Thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show current category links only?’ is closed to new replies.