• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

BuddyBoss - Boss Theme

BuddyBoss - Boss Theme 2.5.7

No permission to download
Anyone know, how likes is defined?

I make this, but it doesnt work

Code:
function topactivities24hwidget() {
registerwidget( 'TopActivities24hWidget' );
}
addaction( 'widgetsinit', 'topactivities24hwidget' );

class TopActivities24hWidget extends WPWidget {
function construct() {
$widgetops = array( 'classname' => 'topactivities24h', 'description' => __('Najlepsze na blogu z 24h', 'topactivities_24h') );
parent::construct( 'top_activities_24h', __('Top Rated Activities (24h)', 'top_activities_24h'), $widget_ops );
}
function widget( $args, $instance ) {
$title = apply_filters( 'widget_title', $instance['title'] );
echo $args['before_widget'];
if ( ! empty( $title ) ) {
echo $args['before_title'] . $title . $args['after_title'];
}

$top_activities_24h = new WP_Query( array(
'meta_key' => 'rating',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'date_query' => array(
array(
'after' => '24 hours ago'
)
),
'posts_per_page' => 5
) );

if ( $top_activities_24h->have_posts() ) :
echo '<ul>';
while ( $top_activities_24h->have_posts() ) : $top_activities_24h->the_post();
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
endwhile;
echo '</ul>';
endif;

wp_reset_postdata();

echo $args['after_widget'];


}

function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = __( 'Top Rated Activities (24h)', 'topactivities24h' );
}
?>

<p>
<label for="<?php echo $this->getfieldid( 'title' ); ?>"><?php e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->getfieldid( 'title' ); ?>" name="<?php echo $this->getfieldname( 'title' ); ?>" type="text" value="<?php echo escattr( $title ); ?>">

</p>


<?php
}

function update( $newinstance, $oldinstance ) {
$instance = array();
$instance['title'] = ( ! empty( $newinstance['title'] ) ) ? striptags( $new_instance['title'] ) : '';
return $instance;
}
}
 
  • Like
Reactions: TechBrain
@TassieNZ the link to download the theme isn't going through... Can you help you re-upload...
 

Attachments

  • Screenshot_20230823-012934.png
    Screenshot_20230823-012934.png
    37.7 KB · Views: 4
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock