• Resolved jmzwiv

    (@jmzwiv)


    Hi!

    I’m looking to use the shortcode to insert the popular pages and posts in a page. It’s not formatting on the page as I’d like though.

    I currently use this;

    Popular pages this month
    [slimstat f='top' w='post_link']limit_results equals 10[/slimstat]

    Popular blog posts this month
    [slimstat f='top' w='resource']content_type equals post&&&limit_results equals 10[/slimstat]

    Which produces;

    Popular pages this month

    <ul class="slimstat-shortcode toppost_link">
    <li><span class="col-post_link"><a href="/somepage/">Some Page</a></span></li>
    ...etc...
    </ul>
    </div>

    Popular blog posts this month

    <ul class="slimstat-shortcode topresource">
    <li><span class="col-resource">/2015/12/some-blog-post/</span></li>
    ...etc...
    </ul>

    So the shortcode using the post_link dimension makes a link with the page title, but the second using the resource dimension just puts the relative URL on the page which is obviously not helpful.

    Have I missed something obvious in how I should be doing this?

    Thanks

    https://www.ads-software.com/plugins/wp-slimstat/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jason Crouse

    (@coolmann)

    Hi,

    I’m not entirely sure I understand what the question is. Are you asking if the second format could also put a link around the path?

    Camu

    Thread Starter jmzwiv

    (@jmzwiv)

    Basically yes. The first example gives a list nice of page titles with clickable links, I’m not sure why the second example doesn’t do the same for blog posts? Am I doing something wrong?

    Plugin Author Jason Crouse

    (@coolmann)

    Well,

    in that case you may want to use w=’post_link’ in the second shortcode, instead of ‘resource’. Have you tried that?

    Camu

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode output formatting question’ is closed to new replies.