In WordPress, there are many useful tools that WordPress provides to enhance your websites. There are menus, widgets, and the most popular, plugins. Plugins are add-on extensions that can add new functions and such. On the Oricale website, I wanted to implement an image gallery to showcase projects without a summary. This prompted me to use the plugin, Advanced Custom Fields, an amazing one that helps out with WordPress.
Advanced Custom Fields is a plugin that allows users to create custom fields to add different add-ons. Users can add any kind of custom field that they want to whether it is a color picker, image gallery, Google Maps, date picker, etc. You can implement any of these using ACF. Since I wanted an image gallery, I implemented one from ACF. I created a custom field and a new page in WordPress admin created a page-gallery.php that would hold the code of the image gallery. I then, assigned the field to the newly created page I made in the admin. After that, I implemented the code into the PHP file and then watched the magic happen.
$images = get_field('gallery');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $images ): ?>
<?php foreach( $images as $image_id ): ?>
<?php echo wp_get_attachment_image( $image_id, $size ); ?>
<?php endforeach; ?>
<?php endif; ?>
The above code is what I used for my advanced custom fields implementation. This created a great image gallery that I wanted, but I also wanted to try out some other plugins for my website and gain an understanding of plugins in WordPress. I installed another plugin called WP Carousel, an image gallery carousel that showcases images in a revolving slider. I was looking for this because I wanted to showcase my images in a slider, and it auto slides.
<?php echo do_shortcode('[sp_wpcarousel id="86"]'); ?>
This was code for the WP carousel, and users only have to customize their images and sizes. Then users can implement the code and the rest is history.
The use of plugins enhances the appearance and functions of a WordPress website. I recommend utilizing plugins when working on a WordPress website