Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-theme.php on line 544

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/comment-template.php on line 1739

Deprecated: wp_getimagesize(): Implicitly marking parameter $image_info as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/media.php on line 5006

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-list.php on line 199

Deprecated: quickdocs\Quickdocs_Menus::render_metabox_dropdown(): Implicitly marking parameter $selected as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/quickdocs/src/class-quickdocs-menus.php on line 154

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\queue(): Implicitly marking parameter $assign as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 22

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\each(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 304

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\each(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 304

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\each_limit(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 323

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\each_limit(): Implicitly marking parameter $onRejected as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 323

Deprecated: YoastSEO_Vendor\GuzzleHttp\Promise\each_limit_all(): Implicitly marking parameter $onFulfilled as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/guzzlehttp/promises/src/functions.php on line 338

Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php on line 60

Deprecated: Creation of dynamic property Yoast\WP\SEO\Main::$helpers is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/lib/abstract-main.php on line 65

Deprecated: popbot\Popbot::__construct(): Implicitly marking parameter $blog_id as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-popbot.php on line 37

Deprecated: popbot\Popbot::create(): Optional parameter $title declared before required parameter $template is implicitly treated as a required parameter in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-popbot.php on line 559

Deprecated: Creation of dynamic property popbot\Admin_Page::$parent is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 19

Deprecated: Creation of dynamic property popbot\Admin_Page::$slug is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 24

Deprecated: Creation of dynamic property popbot\Admin_Page::$title is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 25

Deprecated: Creation of dynamic property popbot\Admin_Page::$hidden is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 26

Deprecated: Creation of dynamic property popbot\Admin_Page::$template is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 27

Deprecated: Creation of dynamic property popbot\Admin_Page::$capability is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 28

Deprecated: Creation of dynamic property popbot\Admin_Page::$icon is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 29

Deprecated: Creation of dynamic property popbot\Admin_Page::$redirect is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 30

Deprecated: Creation of dynamic property popbot\Admin_Page::$scripts is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 31

Deprecated: Creation of dynamic property popbot\Admin_Page::$styles is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 32

Deprecated: Creation of dynamic property popbot\Admin_Page::$parent is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 19

Deprecated: Creation of dynamic property popbot\Admin_Page::$slug is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 24

Deprecated: Creation of dynamic property popbot\Admin_Page::$title is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 25

Deprecated: Creation of dynamic property popbot\Admin_Page::$hidden is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 26

Deprecated: Creation of dynamic property popbot\Admin_Page::$template is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 27

Deprecated: Creation of dynamic property popbot\Admin_Page::$capability is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 28

Deprecated: Creation of dynamic property popbot\Admin_Page::$icon is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 29

Deprecated: Creation of dynamic property popbot\Admin_Page::$redirect is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 30

Deprecated: Creation of dynamic property popbot\Admin_Page::$scripts is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 31

Deprecated: Creation of dynamic property popbot\Admin_Page::$styles is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 32

Deprecated: Creation of dynamic property popbot\Admin_Page::$parent is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 19

Deprecated: Creation of dynamic property popbot\Admin_Page::$slug is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 24

Deprecated: Creation of dynamic property popbot\Admin_Page::$title is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 25

Deprecated: Creation of dynamic property popbot\Admin_Page::$hidden is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 26

Deprecated: Creation of dynamic property popbot\Admin_Page::$template is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 27

Deprecated: Creation of dynamic property popbot\Admin_Page::$capability is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 28

Deprecated: Creation of dynamic property popbot\Admin_Page::$icon is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 29

Deprecated: Creation of dynamic property popbot\Admin_Page::$redirect is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 30

Deprecated: Creation of dynamic property popbot\Admin_Page::$scripts is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 31

Deprecated: Creation of dynamic property popbot\Admin_Page::$styles is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 32

Deprecated: Creation of dynamic property popbot\Admin_Page::$parent is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 19

Deprecated: Creation of dynamic property popbot\Admin_Page::$slug is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 24

Deprecated: Creation of dynamic property popbot\Admin_Page::$title is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 25

Deprecated: Creation of dynamic property popbot\Admin_Page::$hidden is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 26

Deprecated: Creation of dynamic property popbot\Admin_Page::$template is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 27

Deprecated: Creation of dynamic property popbot\Admin_Page::$capability is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 28

Deprecated: Creation of dynamic property popbot\Admin_Page::$icon is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 29

Deprecated: Creation of dynamic property popbot\Admin_Page::$redirect is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 30

Deprecated: Creation of dynamic property popbot\Admin_Page::$scripts is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 31

Deprecated: Creation of dynamic property popbot\Admin_Page::$styles is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 32

Deprecated: Creation of dynamic property popbot\Admin_Page::$parent is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 19

Deprecated: Creation of dynamic property popbot\Admin_Page::$slug is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 24

Deprecated: Creation of dynamic property popbot\Admin_Page::$title is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 25

Deprecated: Creation of dynamic property popbot\Admin_Page::$hidden is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 26

Deprecated: Creation of dynamic property popbot\Admin_Page::$template is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 27

Deprecated: Creation of dynamic property popbot\Admin_Page::$capability is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 28

Deprecated: Creation of dynamic property popbot\Admin_Page::$icon is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 29

Deprecated: Creation of dynamic property popbot\Admin_Page::$redirect is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 30

Deprecated: Creation of dynamic property popbot\Admin_Page::$scripts is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 31

Deprecated: Creation of dynamic property popbot\Admin_Page::$styles is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/popbot/src/class-admin-page.php on line 32

Deprecated: WPSEO_Admin_Asset_Manager::__construct(): Implicitly marking parameter $asset_location as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/admin/class-admin-asset-manager.php on line 43

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated since 8.1, use htmlspecialchars() instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php on line 22

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated since 8.1, use htmlspecialchars() instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php on line 28

Deprecated: WPSEO_Admin_Bar_Menu::__construct(): Implicitly marking parameter $asset_manager as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php on line 62

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-term.php on line 198
WordPress: How to Loop for Custom Post Type Using Bootsrap

WordPress: How to Loop for Custom Post Type Using Bootsrap


Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/vhosts/wrd.studio/httpdocs/blog/wp-includes/class-wp-block-type-registry.php on line 152

A simple little loop that loops through custom posts in WordPress and also shows how Bootstrap works alongside the custom post type loop. The example is used with 4 columns side by side (with col-md-3), but you can change the number to suit whether it is 2 columns, 3 or 4 etc.

Within the loop, you can change the ‘customposttypegoeshere’ to the name of your custom post type. The other parameters are customisable, i.e. define as many posts per page as you wish (here we are returning 24 posts), and you can also edit the orderby and order to suit.

Within the loop, we have chosen to display the post thumbnail, excerpt and title within each column, but these again can be removed or changed to suit your needs. Again, you can wrap the title in a H2 or H3 tag to suit.

<div class="container-fluid">
<?php 
$loop = new WP_Query( 
array(
'post_type' => 'customposttypegoeshere',
'posts_per_page' => 24,
'orderby' => 'date',
'order' => 'DESC'
)
);
?>
<div class="row">
<?php while ( $loop->have_posts() ) : $loop->the_post();?>
<div class="col-md-3 col-lg-3">
<img src="<?php the_post_thumbnail(); ?>" />
<?php the_title(); ?>
<?php the_excerpt();?>
</div>
<?php endwhile; ?>
</div>
</div>

 

If you need any help with Web Maintenance, Web Development Services or Website Security, get in touch with a member of our team and we will be happy to help.