Files
CWC/views/partials/social-media.php
T
Keith Solomon f3c97efcd7
Deploy to Dreamhost (dev) / build (push) Successful in 30s
Sync TODOs with Issues / sync_todos (push) Successful in 6s
🐞 feat: Add contact information section to footer with address, email, and phone icons
2026-06-21 15:12:03 -05:00

40 lines
1.3 KiB
PHP

<?php
/**
* Social Media Links Partial
*
* @package CWC
*/
namespace CWC;
$classes = $args['classes'] ?? '';
$circle = $args['circle'] ?? '';
// Define social media sites and their URLs
$sites = array(
'facebook' => getFieldValue( 'social_media.facebook' ) ? getFieldValue( 'social_media.facebook' ) : '',
'twitter' => getFieldValue( 'social_media.twitter' ) ? getFieldValue( 'social_media.twitter' ) : '',
'pinterest' => getFieldValue( 'social_media.pinterest' ) ? getFieldValue( 'social_media.pinterest' ) : '',
'instagram' => getFieldValue( 'social_media.instagram' ) ? getFieldValue( 'social_media.instagram' ) : '',
'youtube' => getFieldValue( 'social_media.youtube' ) ? getFieldValue( 'social_media.youtube' ) : '',
'linkedin' => getFieldValue( 'social_media.linkedin' ) ? getFieldValue( 'social_media.linkedin' ) : '',
);
// Add circle class if the circle option is enabled
if ( $circle ) {
$classes .= ' circular-icon';
}
// Loop through the social media sites and output links
foreach ( $sites as $name => $url ) {
if ( $url ) {
?>
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $classes ); ?> p-0 leading-none">
<?php get_template_part( 'views/icons/' . $name ); ?>
<span class="sr-only bg-white text-black">Visit our <?php echo esc_html( $name ); ?> page</span>
</a>
<?php
}
}
?>