-
Author
Tagged: shortcode, post count
-
October 3, 2014 at 16:11 #30539sharmstrModerator
I’m thinking that the stats on your pinterest demo are hardcoded and that you haven’t added shortcodes for those numbers. If I’m wrong, can you tell me how you got the daily searches and featured article numbers?
This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.October 3, 2014 at 18:50 #30564AbeKeymasterHi @sharmstr
Unfortunately those are just for demo and they are hard-coded.
If you want we can make a functionality with the daily searches for youHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 3, 2014 at 19:20 #30581sharmstrModeratorThat would be great, but I’m not sure that I’d use it… maybe others will. I’m working on one that will get posts counts by type. I’ll be posting it here when I’m done. I’m just modifying your forum stat shortcode so you guys can probably add it to k-elements if you want. We’ll see 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 6, 2014 at 15:30 #30811sharmstrModeratorHere’s the code for adding a new shortcode item (Post count) within the Kleo shortcode menu to get the amount of published posts by type. When you click on it in the menu, you need to edit the shortcode so that there is only one option
So from this
COPY CODE[colabs_post_count type=post|page|custom post type]
to this
COPY CODE[colabs_post_count type=post]
You can use this within the animated numbers shortcode
COPY CODE[kleo_animate_numbers animation="animate-when-almost-visible" timer="3000"][colabs_post_count type=post][/kleo_animate_numbers]
Put this in functions.php
COPY CODE/*add shortcode to get total number of published posts, pages or custom post types */ function colabs_post_count( $atts, $content = null ) { $a = shortcode_atts( array( 'type' => '', ), $atts ); global $wp; $post_count = wp_count_posts($a['type']); $published_count = $post_count->publish; return $published_count; } add_shortcode( 'colabs_post_count', 'colabs_post_count' ); add_filter( 'kleo_tinymce_shortcodes', create_function('$args','$args[""][] = array("name" => "Post count", "code" => "[colabs_post_count type=post|page|custom post type]"); return $args;' ) );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 6, 2014 at 15:44 #30818sharmstrModerator@abe Forgot to say that I hope its okay that I put the shortcode in the kleo menu. I thought it best not to create a separate menu to save space. I can change it so the menu item title says ‘colabs’ or something.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 9, 2014 at 17:18 #31197AbeKeymasterNo it is OK within the KLEO menu. We will use this and add it in KLEO for others to take advantage of it. Thanks again.
So do you need the daily searches shortcode? I can make it for you if you’ll use it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 9, 2014 at 17:32 #31199sharmstrModeratorNo. I dont need it. Thanks though 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 9, 2014 at 17:47 #31202AbeKeymasterOK 😀
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 26, 2014 at 14:49 #33105sharmstrModeratorThank you for adding this in the latest update. Works great.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 6, 2014 at 17:48 #34369robertsjrParticipantRe: Pinterest style. Are these shortcodes in the latest update or are we hard-coding from sharmstr’s submission above? I don’t have much coding experience but I am getting to grips with what I can. I want to show ‘total posts’ for first column, ‘posts added today’ for the second and ‘total registered members’ for the third.
I appreciate any help on this.
November 6, 2014 at 18:05 #34371sharmstrModeratorThe post count shortcode is in there under Kleo->Content. But there’s not flag for “today”. Total members has been in there for a long time.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
November 6, 2014 at 18:13 #34373robertsjrParticipantOk. Any workaround suggestions for the “today” flag? Thanks for your help.
November 10, 2014 at 19:05 #34912AbeKeymaster@robertsjr unfortunately that is not available right now
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.