Thanks both Anamaria and somchris. Unfortunately it is not working for me 🙁 I can’t understand why…
Sent
It did work! Thank you! 🙂
I have managed to in the meantime reduce the amount of things displayed after the content added and edited by TagDiv Composer. Right now it is only visible the sentence “Här finns det inga inlägg att visa” (Something like “no more posts to show here”).
Hi Bettina!
Unfortunately it doesn’t seem like you read my question. I have seen the guide you are pointing at, but I cannot use that method if I do not have a list with icons and respective code. Where can I find it?
Thanks in advance!
Thanks!
That was a very useful answer Lucian, thanks! I will give it a try using this.
I wish you could add these features to the template. Right now pretty much all the newspaper themes have +/- exakt the same functions. Such features would throw you guys to a cutting edge position since nobody else is offering them…
I do completely understand what you are saying. Just thought on ask you since you know the code way much better than me and could say right away if my suggestions would be impossible. I am going to give it a try. If you want to give me a bit more help I would have no issues on making the code available for you or the whole community.
Thanks and keep up with the hard work!
I also found this: http://www.wpbeginner.com/wp-tutorials/how-to-display-a-category-only-if-it-has-posts-in-wordpress/
It’s another approach, would it work? How could I apply it?
Ok… what if we manage to add a class to a post everytime we want it to be sticky? Then we can create an alternative news flood and through CSS make it invisible (no styling). This flood shows news from the post category “sticky” only. Then the person who is writing the new post can check a radio button to add that class and attribute the “sticky” category. That class will then make the post display:block.
Would this work?
Well, can you recommend any workarround? A special category that is only shown if it has news for instance would save the day….
Hi! I am going to make a new Newspapper site. Did you solve this issue? I see you have made a series of updates, did you include the sticky posts on the updates? The option of being able to filter news in blocks by writing ID is not a solution since it forces my customers to “be technicians” and create/delete a block everytime they need a sticky post.
Any solution for this already?
-
This reply was modified 10 years by
jonybigude.
That is just awesome! How can I keep updated in this matter?
No prob, different websites have different needs. In my case, the customer doesn’t want any slider so that is out of the question for me. My customer also wants to have a layout extremely similar to his old website which in this case means only one main feed.
I would like to have another design (more modern and less irritating) but this is the result and it is exactly what he wants: http://värnamo.nu/
I would like to make a new and very important request:
* Offer a solution for sticky posts! for more info read this https://forum.tagdiv.com/topic/show-a-block-only-when-it-has-news/#post-72867 or this https://forum.tagdiv.com/topic/sticky-posts-2/
Thanks!
This shortcode will also work well: [ic_add_posts category=’category-slug’]
There is an important update to all of you searching for a solution for this:
https://forum.tagdiv.com/topic/show-a-block-only-when-it-has-news/#post-72867
OK, there is some light at the end of the tunel! I have found this plugin that works almost as I want: https://wordpress.org/plugins/posts-in-page/installation/
By using the shortcode [ic_add_posts ignore_sticky_posts=’no’] paste on a plain text box at Visual Composer, all sticky posts are shown!
The only if is that the post does not show the post thumb! Please TagDiv, can you adapt this plugin to your theme and include it as a solution for this issue? Please??
I’m not sure I understand you whe you say:
This is not a normal thing since that is kind of what a ‘featured’ category has traditionally been used for in WP — meaning, you have a “sticky” category, and then you only have one item in it; then edit that post when you no longer want it featured.
The sticky posts feature is off and it does not work when changing the file td_data_source.php because I am filtering several categories. I desperatly need this feature though. So, I need a workaround for this!
I have got an answer on another forum (PHP forum) to try to solve this:
add_filter('get_terms', 'get_terms_filter', 10, 3);
function get_terms_filter( $terms, $taxonomies, $args )
{
global $wpdb;
$taxonomy = $taxonomies[0];
if ( ! is_array($terms) && count($terms) < 1 )
return $terms;
$filtered_terms = array();
foreach ( $terms as $term )
{
$result = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts p JOIN $wpdb->term_relationships rl ON p.ID = rl.object_id WHERE rl.term_taxonomy_id = $term->term_id AND p.post_status = 'publish' LIMIT 1");
if ( intval($result) > 0 )
$filtered_terms[] = $term;
}
return $filtered_terms;
}
Would it work? My knowledge on PHP is very limited…
Any other solutions?
Really appreciate you pass it to the developers and I will be looking forward to this update!
We need a fix for this… :/
It’s really not working, is it bercause I filter the block with different categories?
I tried to make a workarround by creating a new block on top of that one and filter after a new category for sticky posts. It didn’t work as the block is allways shown no matter if there are posts or not (when no posts exist on category, the block shows empty with the top colored bar).
I really love this theme but I also really need this feature. It’s really a must have! Sticky posts are one of the most core functions of wordpress, how come you didn’t think of this?
How can I workarround this?
Sure, take a look:
That’s exactly what I did, still no results :/ Is there any workaround?
