✨feature: Enhance footer with social media links and styling updates
Sync TODOs with Issues / sync_todos (push) Successful in 6s
Sync TODOs with Issues / sync_todos (push) Successful in 6s
This commit is contained in:
+12
-121
@@ -84,8 +84,8 @@
|
|||||||
"label": "Social Media",
|
"label": "Social Media",
|
||||||
"name": "social_media",
|
"name": "social_media",
|
||||||
"aria-label": "",
|
"aria-label": "",
|
||||||
"type": "group",
|
"type": "repeater",
|
||||||
"instructions": "",
|
"instructions": "Add social media links. The service icon will be auto-detected from the URL domain.",
|
||||||
"required": 0,
|
"required": 0,
|
||||||
"conditional_logic": 0,
|
"conditional_logic": 0,
|
||||||
"wrapper": {
|
"wrapper": {
|
||||||
@@ -93,15 +93,19 @@
|
|||||||
"class": "",
|
"class": "",
|
||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"layout": "row",
|
"collapsed": "",
|
||||||
|
"min": 0,
|
||||||
|
"max": 0,
|
||||||
|
"layout": "table",
|
||||||
|
"button_label": "Add Social Link",
|
||||||
"sub_fields": [
|
"sub_fields": [
|
||||||
{
|
{
|
||||||
"key": "field_677bf0e692d3c",
|
"key": "field_677bf0e692d40",
|
||||||
"label": "Facebook",
|
"label": "URL",
|
||||||
"name": "facebook",
|
"name": "url",
|
||||||
"aria-label": "",
|
"aria-label": "",
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"instructions": "",
|
"instructions": "Enter the full URL to your social media profile",
|
||||||
"required": 0,
|
"required": 0,
|
||||||
"conditional_logic": 0,
|
"conditional_logic": 0,
|
||||||
"wrapper": {
|
"wrapper": {
|
||||||
@@ -112,78 +116,6 @@
|
|||||||
"default_value": "",
|
"default_value": "",
|
||||||
"allow_in_bindings": 1,
|
"allow_in_bindings": 1,
|
||||||
"placeholder": ""
|
"placeholder": ""
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_677bf0e692d3e",
|
|
||||||
"label": "Instagram",
|
|
||||||
"name": "instagram",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "url",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "",
|
|
||||||
"allow_in_bindings": 1,
|
|
||||||
"placeholder": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_677bf0e692d3d",
|
|
||||||
"label": "X\/Twitter",
|
|
||||||
"name": "twitter",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "url",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "",
|
|
||||||
"allow_in_bindings": 1,
|
|
||||||
"placeholder": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_677bf0e692d41",
|
|
||||||
"label": "LinkedIn",
|
|
||||||
"name": "linkedin",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "url",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "",
|
|
||||||
"allow_in_bindings": 1,
|
|
||||||
"placeholder": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_6a82713dd82d4",
|
|
||||||
"label": "Github",
|
|
||||||
"name": "github",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "url",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "",
|
|
||||||
"allow_in_bindings": 0,
|
|
||||||
"placeholder": ""
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -289,26 +221,6 @@
|
|||||||
"max_size": "",
|
"max_size": "",
|
||||||
"mime_types": ""
|
"mime_types": ""
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "field_64761ea8cb0dd",
|
|
||||||
"label": "Footer Description",
|
|
||||||
"name": "footer_description",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "wysiwyg",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "",
|
|
||||||
"tabs": "all",
|
|
||||||
"toolbar": "full",
|
|
||||||
"media_upload": 1,
|
|
||||||
"delay": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "field_61df3348c3795",
|
"key": "field_61df3348c3795",
|
||||||
"label": "Copyright Text",
|
"label": "Copyright Text",
|
||||||
@@ -329,27 +241,6 @@
|
|||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"prepend": "",
|
"prepend": "",
|
||||||
"append": ""
|
"append": ""
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "field_684af923d5f68",
|
|
||||||
"label": "Credit Text",
|
|
||||||
"name": "credit_text",
|
|
||||||
"aria-label": "",
|
|
||||||
"type": "text",
|
|
||||||
"instructions": "",
|
|
||||||
"required": 0,
|
|
||||||
"conditional_logic": 0,
|
|
||||||
"wrapper": {
|
|
||||||
"width": "",
|
|
||||||
"class": "",
|
|
||||||
"id": ""
|
|
||||||
},
|
|
||||||
"default_value": "Web Design & Development by <a href=\"https:\/\/vincentdesign.ca\/\"><strong>Vincent Design<\/strong><\/a>",
|
|
||||||
"maxlength": "",
|
|
||||||
"allow_in_bindings": 1,
|
|
||||||
"placeholder": "",
|
|
||||||
"prepend": "",
|
|
||||||
"append": ""
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -417,5 +308,5 @@
|
|||||||
"display_title": "",
|
"display_title": "",
|
||||||
"allow_ai_access": false,
|
"allow_ai_access": false,
|
||||||
"ai_description": "",
|
"ai_description": "",
|
||||||
"modified": 1787063276
|
"modified": 1787502285
|
||||||
}
|
}
|
||||||
|
|||||||
+66
-19
@@ -25,22 +25,26 @@ $footerNav = ! empty( $locations['footer_navigation'] )
|
|||||||
|
|
||||||
<footer role="contentinfo" class="site-footer">
|
<footer role="contentinfo" class="site-footer">
|
||||||
<div class="container mx-auto py-12">
|
<div class="container mx-auto py-12">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
|
<div class="flex flex-col-reverse lg:flex-row justify-between gap-8">
|
||||||
<div class="site-footer__brand max-w-[40ch]">
|
<div class="site-footer__brand max-w-[40ch]">
|
||||||
<h2 class="site-footer__title">
|
<h2 class="site-footer__title">
|
||||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||||
<?php if ( $footerLogo ) { ?>
|
<?php echo esc_html( get_bloginfo( 'name' ) ); ?>
|
||||||
<img src="<?php echo esc_url( $footerLogo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
echo esc_html( get_bloginfo( 'name' ) );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
<?php if ( $footerDesc ) : ?>
|
|
||||||
<p class="site-footer__desc"><?php echo wp_kses_post( $footerDesc ); ?></p>
|
<div class="social-links">
|
||||||
<?php endif; ?>
|
<?php
|
||||||
|
get_template_part(
|
||||||
|
'views/partials/social-media',
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'circle' => false,
|
||||||
|
'classes' => 'social-icons p-0 mr-1',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -57,15 +61,58 @@ $footerNav = ! empty( $locations['footer_navigation'] )
|
|||||||
|
|
||||||
<?php if ( $footerNav ) : ?>
|
<?php if ( $footerNav ) : ?>
|
||||||
<nav class="site-footer__nav" aria-label="<?php echo esc_attr__( 'Footer navigation', 'ks-portfolio' ); ?>">
|
<nav class="site-footer__nav" aria-label="<?php echo esc_attr__( 'Footer navigation', 'ks-portfolio' ); ?>">
|
||||||
<h3><?php echo esc_html__( 'Navigation', 'ks-portfolio' ); ?></h3>
|
<h3><?php echo esc_html__( 'Quick Links', 'ks-portfolio' ); ?></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ( $footerNav as $item ) : ?>
|
<?php
|
||||||
<li>
|
// Build a tree of parent -> children relationships
|
||||||
<a href="<?php echo esc_url( $item->url ); ?>">
|
$menu_items_by_parent = array();
|
||||||
<?php echo esc_html( $item->title ); ?>
|
foreach ( $footerNav as $item ) {
|
||||||
</a>
|
$parent_id = (int) $item->menu_item_parent;
|
||||||
</li>
|
if ( ! isset( $menu_items_by_parent[ $parent_id ] ) ) {
|
||||||
<?php endforeach; ?>
|
$menu_items_by_parent[ $parent_id ] = array();
|
||||||
|
}
|
||||||
|
$menu_items_by_parent[ $parent_id ][] = $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display top-level items (parent = 0)
|
||||||
|
if ( isset( $menu_items_by_parent[0] ) ) {
|
||||||
|
foreach ( $menu_items_by_parent[0] as $item ) :
|
||||||
|
// Check if this is the contact link
|
||||||
|
$is_contact = false;
|
||||||
|
if ( function_exists( 'get_field' ) ) {
|
||||||
|
$contact_link = get_field( 'contact_info.email', 'option' );
|
||||||
|
if ( $contact_link && strpos( $item->url, 'contact' ) !== false ) {
|
||||||
|
$is_contact = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<li<?php echo $is_contact ? ' class="site-footer__nav-contact"' : ''; ?>>
|
||||||
|
<a href="<?php echo esc_url( $item->url ); ?>" class="<?php echo $is_contact ? 'button button-primary' : ''; ?>">
|
||||||
|
<?php echo esc_html( $item->title ); ?>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Check for child items
|
||||||
|
$item_id = (int) $item->ID;
|
||||||
|
if ( isset( $menu_items_by_parent[ $item_id ] ) ) {
|
||||||
|
?>
|
||||||
|
<ul class="site-footer__nav-submenu">
|
||||||
|
<?php foreach ( $menu_items_by_parent[ $item_id ] as $child_item ) : ?>
|
||||||
|
<li class="site-footer__nav-submenu-item">
|
||||||
|
<a href="<?php echo esc_url( $child_item->url ); ?>">
|
||||||
|
<?php echo esc_html( $child_item->title ); ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</li>
|
||||||
|
<?php
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ $showHero = in_array(
|
|||||||
<html <?php language_attributes(); ?>>
|
<html <?php language_attributes(); ?>>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title><?php wp_title( '' ); ?></title>
|
|
||||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
|||||||
@@ -4,24 +4,150 @@
|
|||||||
background: var(--color-surface, #121318);
|
background: var(--color-surface, #121318);
|
||||||
color: var(--color-on-surface, #e3e1e9);
|
color: var(--color-on-surface, #e3e1e9);
|
||||||
border-top: 1px solid var(--color-outline-variant, #444651);
|
border-top: 1px solid var(--color-outline-variant, #444651);
|
||||||
}
|
|
||||||
.site-footer__title a { color: var(--color-on-surface, #e3e1e9); text-decoration: none; }
|
.site-footer__title a { color: #e3e1e9; text-decoration: none; }
|
||||||
.site-footer__desc { color: var(--color-on-surface-variant, #c5c5d3); }
|
|
||||||
.site-footer__area h3,
|
.site-footer__area h3,
|
||||||
.site-footer__nav h3 {
|
.site-footer__nav h3 {
|
||||||
color: var(--color-on-surface, #e3e1e9);
|
color: var(--color-on-surface, #e3e1e9);
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin: 0 0 0.75rem;
|
margin: 0 0 0.75rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
border-bottom: 1px solid var(--color-outline-variant, #444651);
|
border-bottom: 1px solid var(--color-outline-variant, #444651);
|
||||||
}
|
}
|
||||||
.site-footer a { color: var(--color-primary, #b6c4ff); }
|
|
||||||
.site-footer a:hover { text-decoration: underline; }
|
.site-footer a { color: #b6c4ff; }
|
||||||
.site-footer__copyright {
|
|
||||||
background: var(--color-surface-container-lowest, #0d0e13);
|
.site-footer a:hover { text-decoration: underline; }
|
||||||
color: var(--color-on-surface-variant, #c5c5d3);
|
|
||||||
text-align: center;
|
.site-footer__copyright {
|
||||||
padding: 0.75rem;
|
background: var(--color-surface-container-lowest, #0d0e13);
|
||||||
font-size: 0.875rem;
|
color: var(--color-on-surface-variant, #c5c5d3);
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.75rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Social media links styling */
|
||||||
|
.social-links {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-links a {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SVG icon alignment */
|
||||||
|
.site-footer svg {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Quick Links styling */
|
||||||
|
.site-footer__nav ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav > ul > li {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.25rem;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav > ul > li:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Main menu items with SVG marker */
|
||||||
|
.site-footer__nav > ul > li > a {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav > ul > li > a::before {
|
||||||
|
content: '';
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.15533 5.59469C6.94083 5.38019 6.61824 5.31603 6.33799 5.43211C6.05773 5.5482 5.875 5.82168 5.875 6.12502V18.625C5.875 18.9284 6.05773 19.2018 6.33799 19.3179C6.61824 19.434 6.94083 19.3699 7.15533 19.1554L13.4053 12.9054C13.6982 12.6125 13.6982 12.1376 13.4053 11.8447L7.15533 5.59469Z' fill='%23b6c4ff'/%3E%3Cpath opacity='0.4' d='M11.6553 5.59467C11.3624 5.30178 10.8876 5.30178 10.5947 5.59467C10.3018 5.88756 10.3018 6.36244 10.5947 6.65533L16.3143 12.375L10.5947 18.0947C10.3018 18.3876 10.3018 18.8624 10.5947 19.1553C10.8876 19.4482 11.3624 19.4482 11.6553 19.1553L17.9053 12.9053C18.1982 12.6124 18.1982 12.1376 17.9053 11.8447L11.6553 5.59467Z' fill='%23b6c4ff'/%3E%3C/svg%3E");
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Submenu styling */
|
||||||
|
.site-footer__nav-submenu {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0.5rem 0 0 4rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-submenu-item {
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-submenu-item a {
|
||||||
|
color: #b6c4ff;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-submenu-item a::before {
|
||||||
|
content: '';
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.15533 5.59469C6.94083 5.38019 6.61824 5.31603 6.33799 5.43211C6.05773 5.5482 5.875 5.82168 5.875 6.12502V18.625C5.875 18.9284 6.05773 19.2018 6.33799 19.3179C6.61824 19.434 6.94083 19.3699 7.15533 19.1554L13.4053 12.9054C13.6982 12.6125 13.6982 12.1376 13.4053 11.8447L7.15533 5.59469Z' fill='%23b6c4ff'/%3E%3Cpath opacity='0.4' d='M11.6553 5.59467C11.3624 5.30178 10.8876 5.30178 10.5947 5.59467C10.3018 5.88756 10.3018 6.36244 10.5947 6.65533L16.3143 12.375L10.5947 18.0947C10.3018 18.3876 10.3018 18.8624 10.5947 19.1553C10.8876 19.4482 11.3624 19.4482 11.6553 19.1553L17.9053 12.9053C18.1982 12.6124 18.1982 12.1376 17.9053 11.8447L11.6553 5.59467Z' fill='%23b6c4ff'/%3E%3C/svg%3E");
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-submenu a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Contact button styling */
|
||||||
|
.site-footer__nav-contact > a.button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background-color: #b6c4ff;
|
||||||
|
color: #121318;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-contact > a.button::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-contact > a.button:hover {
|
||||||
|
background-color: #e3e1e9;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-footer__nav-contact {
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
border-top: 1px solid var(--color-outline-variant, #444651);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ $wrapper = blockWrapperAttributes( $classes, $is_preview );
|
|||||||
<section <?php echo wp_kses_post( $wrapper ); ?>>
|
<section <?php echo wp_kses_post( $wrapper ); ?>>
|
||||||
<header class="home-recent__head">
|
<header class="home-recent__head">
|
||||||
<h2 class="home-recent__title"><?php echo esc_html__( 'Recent Projects', 'ks-portfolio' ); ?></h2>
|
<h2 class="home-recent__title"><?php echo esc_html__( 'Recent Projects', 'ks-portfolio' ); ?></h2>
|
||||||
|
|
||||||
<a class="home-recent__view-all" href="<?php echo esc_url( get_post_type_archive_link( 'projects' ) ); ?>">
|
<a class="home-recent__view-all" href="<?php echo esc_url( get_post_type_archive_link( 'projects' ) ); ?>">
|
||||||
<?php echo esc_html__( 'View All', 'ks-portfolio' ); ?> →
|
<?php echo esc_html__( 'View All', 'ks-portfolio' ); ?> →
|
||||||
</a>
|
</a>
|
||||||
@@ -43,8 +44,10 @@ $wrapper = blockWrapperAttributes( $classes, $is_preview );
|
|||||||
<?php
|
<?php
|
||||||
while ( $recent->have_posts() ) :
|
while ( $recent->have_posts() ) :
|
||||||
$recent->the_post();
|
$recent->the_post();
|
||||||
|
|
||||||
get_template_part( 'views/components/project-card' );
|
get_template_part( 'views/components/project-card' );
|
||||||
endwhile;
|
endwhile;
|
||||||
|
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,19 +17,20 @@ if ( ! isset( $post ) || ! ( $post instanceof \WP_Post ) ) {
|
|||||||
$project_id = (int) $post->ID;
|
$project_id = (int) $post->ID;
|
||||||
$type_label = '';
|
$type_label = '';
|
||||||
$type_terms = get_the_terms( $project_id, 'project-type' );
|
$type_terms = get_the_terms( $project_id, 'project-type' );
|
||||||
|
|
||||||
if ( ! empty( $type_terms ) && ! is_wp_error( $type_terms ) ) {
|
if ( ! empty( $type_terms ) && ! is_wp_error( $type_terms ) ) {
|
||||||
$type_label = strtoupper( $type_terms[0]->name );
|
$type_label = strtoupper( $type_terms[0]->name );
|
||||||
}
|
}
|
||||||
$is_website = Projects::is_website( $project_id );
|
|
||||||
$site_url = Projects::get_site_url( $project_id );
|
$is_website = Projects::is_website( $project_id );
|
||||||
|
$site_url = Projects::get_site_url( $project_id );
|
||||||
$site_platform = Projects::get_site_platform( $project_id );
|
$site_platform = Projects::get_site_platform( $project_id );
|
||||||
$release_url = Projects::get_release_url( $project_id );
|
$release_url = Projects::get_release_url( $project_id );
|
||||||
$repo_url = Projects::get_repo_browse_url( $project_id );
|
$repo_url = Projects::get_repo_browse_url( $project_id );
|
||||||
$repo_data = Projects::get_repo_data( $project_id );
|
$repo_data = Projects::get_repo_data( $project_id );
|
||||||
$language = is_array( $repo_data ) && ! empty( $repo_data['language'] ) ? (string) $repo_data['language'] : '';
|
$language = is_array( $repo_data ) && isset( $repo_data['stargazers_count'] ) ? (int) $repo_data['stargazers_count'] : 0;
|
||||||
$stars = is_array( $repo_data ) && isset( $repo_data['stargazers_count'] ) ? (int) $repo_data['stargazers_count'] : 0;
|
$excerpt = has_excerpt( $project_id ) ? get_the_excerpt( $project_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
|
||||||
$excerpt = has_excerpt( $project_id ) ? get_the_excerpt( $project_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
|
$card_classes = 'project-card group';
|
||||||
$card_classes = 'project-card group';
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $project_id ); ?>-title">
|
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $project_id ); ?>-title">
|
||||||
@@ -37,6 +38,7 @@ $card_classes = 'project-card group';
|
|||||||
<?php if ( $type_label ) : ?>
|
<?php if ( $type_label ) : ?>
|
||||||
<span class="project-card__type"><?php echo esc_html( $type_label ); ?></span>
|
<span class="project-card__type"><?php echo esc_html( $type_label ); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<span class="project-card__provider" aria-hidden="true">
|
<span class="project-card__provider" aria-hidden="true">
|
||||||
<?php echo esc_html( $is_website ? __( 'Website', 'ks-portfolio' ) : Projects::get_provider_label( $project_id ) ); ?>
|
<?php echo esc_html( $is_website ? __( 'Website', 'ks-portfolio' ) : Projects::get_provider_label( $project_id ) ); ?>
|
||||||
</span>
|
</span>
|
||||||
@@ -58,7 +60,8 @@ $card_classes = 'project-card group';
|
|||||||
<?php if ( $language ) : ?>
|
<?php if ( $language ) : ?>
|
||||||
<span class="project-card__lang"><?php echo esc_html( $language ); ?></span>
|
<span class="project-card__lang"><?php echo esc_html( $language ); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $stars > 0 ) : ?>
|
|
||||||
|
<?php if ( $stars > 0 ) : ?>
|
||||||
<span class="project-card__stars" aria-label="<?php echo esc_attr( $stars . ' stars' ); ?>">★ <?php echo esc_html( (string) $stars ); ?></span>
|
<span class="project-card__stars" aria-label="<?php echo esc_attr( $stars . ' stars' ); ?>">★ <?php echo esc_html( (string) $stars ); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,7 +84,8 @@ $card_classes = 'project-card group';
|
|||||||
<?php echo esc_html__( 'Download', 'ks-portfolio' ); ?>
|
<?php echo esc_html__( 'Download', 'ks-portfolio' ); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $repo_url ) : ?>
|
|
||||||
|
<?php if ( $repo_url ) : ?>
|
||||||
<a class="project-card__action project-card__action--secondary" href="<?php echo esc_url( $repo_url ); ?>" target="_blank" rel="noopener noreferrer">
|
<a class="project-card__action project-card__action--secondary" href="<?php echo esc_url( $repo_url ); ?>" target="_blank" rel="noopener noreferrer">
|
||||||
<?php echo esc_html__( 'View Repo', 'ks-portfolio' ); ?>
|
<?php echo esc_html__( 'View Repo', 'ks-portfolio' ); ?>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ if ( ! isset( $stat_label ) || ! isset( $stat_value ) ) {
|
|||||||
$stat_label = (string) $stat_label;
|
$stat_label = (string) $stat_label;
|
||||||
$stat_value = (string) $stat_value;
|
$stat_value = (string) $stat_value;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="stat-card" role="group" aria-label="<?php echo esc_attr( $stat_label ); ?>">
|
<div class="stat-card" role="group" aria-label="<?php echo esc_attr( $stat_label ); ?>">
|
||||||
<?php if ( ! empty( $icon ) ) : ?>
|
<?php if ( ! empty( $icon ) ) : ?>
|
||||||
<span class="stat-card__icon" aria-hidden="true"><?php echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- icon is hardcoded decorative SVG in callers. ?></span>
|
<span class="stat-card__icon" aria-hidden="true"><?php echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- icon is hardcoded decorative SVG in callers. ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<span class="stat-card__value"><?php echo esc_html( $stat_value ); ?></span>
|
|
||||||
|
<span class="stat-card__value"><?php echo esc_html( $stat_value ); ?></span>
|
||||||
<span class="stat-card__label"><?php echo esc_html( $stat_label ); ?></span>
|
<span class="stat-card__label"><?php echo esc_html( $stat_label ); ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg viewBox="0 0 24 24" width="1.5rem" height="1.5rem" role="img" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M4.209 4.603c-.247 0-.525.02-.84.088-.333.07-1.28.283-2.054 1.027C-.403 7.25.035 9.685.089 10.052c.065.446.263 1.687 1.21 2.768 1.749 2.141 5.513 2.092 5.513 2.092s.462 1.103 1.168 2.119c.955 1.263 1.936 2.248 2.89 2.367 2.406 0 7.212-.004 7.212-.004s.458.004 1.08-.394c.535-.324 1.013-.893 1.013-.893s.492-.527 1.18-1.73c.21-.37.385-.729.538-1.068 0 0 2.107-4.471 2.107-8.823-.042-1.318-.367-1.55-.443-1.627-.156-.156-.366-.153-.366-.153s-4.475.252-6.792.306c-.508.011-1.012.023-1.512.027v4.474l-.634-.301c0-1.39-.004-4.17-.004-4.17-1.107.016-3.405-.084-3.405-.084s-5.399-.27-5.987-.324c-.187-.011-.401-.032-.648-.032zm.354 1.832h.111s.271 2.269.6 3.597C5.549 11.147 6.22 13 6.22 13s-.996-.119-1.641-.348c-.99-.324-1.409-.714-1.409-.714s-.73-.511-1.096-1.52C1.444 8.73 2.021 7.7 2.021 7.7s.32-.859 1.47-1.145c.395-.106.863-.12 1.072-.12zm8.33 2.554c.26.003.509.127.509.127l.868.422-.529 1.075a.686.686 0 0 0-.614.359.685.685 0 0 0 .072.756l-.939 1.924a.69.69 0 0 0-.66.527.687.687 0 0 0 .347.763.686.686 0 0 0 .867-.206.688.688 0 0 0-.069-.882l.916-1.874a.667.667 0 0 0 .237-.02.657.657 0 0 0 .271-.137 8.826 8.826 0 0 1 1.016.512.761.761 0 0 1 .286.282c.073.21-.073.569-.073.569-.087.29-.702 1.55-.702 1.55a.692.692 0 0 0-.676.477.681.681 0 1 0 1.157-.252c.073-.141.141-.282.214-.431.19-.397.515-1.16.515-1.16.035-.066.218-.394.103-.814-.095-.435-.48-.638-.48-.638-.467-.301-1.116-.58-1.116-.58s0-.156-.042-.27a.688.688 0 0 0-.148-.241l.516-1.062 2.89 1.401s.48.218.583.619c.073.282-.019.534-.069.657-.24.587-2.1 4.317-2.1 4.317s-.232.554-.748.588a1.065 1.065 0 0 1-.393-.045l-.202-.08-4.31-2.1s-.417-.218-.49-.596c-.083-.31.104-.691.104-.691l2.073-4.272s.183-.37.466-.497a.855.855 0 0 1 .35-.077z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<i class="icon-github"></i>
|
||||||
@@ -11,30 +11,64 @@ $args = $args ?? array();
|
|||||||
$classes = $args['classes'] ?? '';
|
$classes = $args['classes'] ?? '';
|
||||||
$circle = $args['circle'] ?? '';
|
$circle = $args['circle'] ?? '';
|
||||||
|
|
||||||
// Define social media sites and their URLs
|
// Get social media repeater data
|
||||||
$sites = array(
|
$social_media_items = get_field( 'social_media', 'option' );
|
||||||
'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
|
// Add circle class if the circle option is enabled
|
||||||
if ( $circle ) {
|
if ( $circle ) {
|
||||||
$classes .= ' circular-icon';
|
$classes .= ' circular-icon';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through the social media sites and output links
|
/**
|
||||||
foreach ( $sites as $name => $url ) {
|
* Detect social media service from URL
|
||||||
if ( $url ) {
|
*
|
||||||
?>
|
* @param string $url The social media URL.
|
||||||
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
* @return string The service name
|
||||||
<?php get_template_part( 'views/icons/' . $name ); ?>
|
*/
|
||||||
<span class="sr-only bg-white text-black">Visit our <?php echo esc_html( $name ); ?> page</span>
|
function detect_social_service( $url ) {
|
||||||
</a>
|
$domain = wp_parse_url( $url, PHP_URL_HOST );
|
||||||
<?php
|
$domain = strtolower( $domain );
|
||||||
|
|
||||||
|
// Define domain patterns for each service
|
||||||
|
$services = array(
|
||||||
|
'facebook' => array( 'facebook.com', 'fb.com' ),
|
||||||
|
'instagram' => array( 'instagram.com' ),
|
||||||
|
'twitter' => array( 'twitter.com', 'x.com' ),
|
||||||
|
'linkedin' => array( 'linkedin.com' ),
|
||||||
|
'github' => array( 'github.com' ),
|
||||||
|
'youtube' => array( 'youtube.com', 'youtu.be' ),
|
||||||
|
'pinterest' => array( 'pinterest.com' ),
|
||||||
|
'gitea' => array( 'gitea.com', 'keithsolomon.net', 'codeberg.org' ),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ( $services as $service => $domains ) {
|
||||||
|
foreach ( $domains as $service_domain ) {
|
||||||
|
if ( strpos( $domain, $service_domain ) !== false ) {
|
||||||
|
return $service;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop through the social media repeater items and output links
|
||||||
|
if ( $social_media_items && is_array( $social_media_items ) ) {
|
||||||
|
foreach ( $social_media_items as $item ) {
|
||||||
|
$url = $item['url'] ?? '';
|
||||||
|
|
||||||
|
if ( $url ) {
|
||||||
|
$service = detect_social_service( $url );
|
||||||
|
|
||||||
|
if ( $service ) {
|
||||||
|
?>
|
||||||
|
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
||||||
|
<?php get_template_part( 'views/icons/' . $service ); ?>
|
||||||
|
<span class="sr-only bg-white text-black">Visit my <?php echo esc_html( $service ); ?> page</span>
|
||||||
|
</a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user