[DiscordArchive] No veteran discount?
[DiscordArchive] No veteran discount?
Archived author: M'Dic • Posted: 2023-01-04T16:11:44.236000+00:00
Original source
No veteran discount?
Archived author: M'Dic • Posted: 2023-01-04T16:11:49.092000+00:00
Original source
<:kek:868839618898960414>
Archived author: M'Dic • Posted: 2023-01-04T16:11:53.326000+00:00
Original source
I want my 10%
Archived author: Guybrush • Posted: 2023-01-04T16:11:54.745000+00:00
Original source
Only for Uncle Sam
Archived author: M'Dic • Posted: 2023-01-04T16:12:15.413000+00:00
Original source
Uncle Sam was more kind then Scout Master Kevin
Archived author: M'Dic • Posted: 2023-01-04T16:12:40.108000+00:00
Original source
Archived author: Guybrush • Posted: 2023-01-04T16:13:33.160000+00:00
Original source
```php
function wpb_rand_posts($atts = [])
{
// normalize attribute keys, lowercase
$atts = array_change_key_case( (array) $atts, CASE_LOWER );
if (!array_key_exists('category_id', $atts)) {
return "You need to provide a category id, dummy!";
}
$args = array(
'post_type' => 'post',
'orderby' => 'rand',
'posts_per_page' => 5,
'cat' => $atts['category_id'],
);
$the_query = new WP_Query($args);
if (!$the_query->have_posts()) {
return "No posts found";
}
shuffle($the_query->posts);
$string .= '<ul>';
while ($the_query->have_posts()) {
$the_query->the_post();
$string .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
}
$string .= '</ul>';
wp_reset_postdata();
return $string;
}
add_shortcode('wpb-random-posts', 'wpb_rand_posts');
add_filter('widget_text', 'do_shortcode');
```
```html
// usage
[wpb-rand-posts category_id="69"]
```
Archived author: Guybrush • Posted: 2023-01-04T16:13:59.996000+00:00
Original source
also https://developer.wordpress.org/plugins/...arameters/
Archived author: Guybrush • Posted: 2023-01-04T16:18:48.876000+00:00
Original source
I have to retract my "even for wordpress" comment. Their own documentation suggests stupid shit
Archived author: Guybrush • Posted: 2023-01-04T16:19:42.966000+00:00
Original source
_looks longingly at the market share for wordpress_