Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add social network in the Customizer #123

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,24 @@ function wp_indigo_customize_preview_js() {
]
);

new \Kirki\Field\URL(
[
'settings' => 'mastodon',
'label' => __( 'Mastodon', 'wp-indigo' ),
'section' => 'socials',
'priority' => 220,
]
);

new \Kirki\Field\URL(
[
'settings' => 'bluesky',
'label' => __( 'Bluesky', 'wp-indigo' ),
'section' => 'socials',
'priority' => 230,
]
);

/*------------------------------------*\
#Theme Colors
\*------------------------------------*/
Expand Down
12 changes: 11 additions & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ function wp_indigo_socials_links() {
$wp_indigo_behance = get_theme_mod( 'behance', "" );
$wp_indigo_telegram = get_theme_mod( 'telegram', "" );
$wp_indigo_codepen = get_theme_mod( 'codepen', "" );
$wp_indigo_mastodon = get_theme_mod( 'mastodon', "" );
$wp_indigo_bluesky = get_theme_mod( 'bluesky', "" );


// If variable was not empty will display the icons
$wp_indigo_social_variables = array($wp_indigo_facebook,$wp_indigo_twitter,$wp_indigo_instagram,$wp_indigo_linkedin,$wp_indigo_github,
$wp_indigo_mail, $wp_indigo_pinterest ,$wp_indigo_youtube ,$wp_indigo_spotify , $wp_indigo_gitlab,$wp_indigo_lastfm ,$wp_indigo_stackoverflow ,$wp_indigo_quora ,$wp_indigo_reddit ,$wp_indigo_medium ,
$wp_indigo_vimeo, $wp_indigo_lanyrd,$wp_indigo_dribbble ,$wp_indigo_behance,$wp_indigo_telegram,$wp_indigo_codepen
$wp_indigo_vimeo, $wp_indigo_lanyrd,$wp_indigo_dribbble ,$wp_indigo_behance,$wp_indigo_telegram,$wp_indigo_codepen,$wp_indigo_mastodon,$wp_indigo_bluesky
) ;

// Check if one of the variables are not empty
Expand Down Expand Up @@ -255,6 +257,14 @@ function wp_indigo_socials_links() {
echo sprintf( '<a href="%s" aria-label="%s" class="c-social-share__item" target="_blank"><span class=" c-social-share__icon iconify" data-icon="akar-icons:codepen-fill" data-inline="false"></span></a>', esc_url( $wp_indigo_codepen ), esc_html__( 'Codepen', 'wp-indigo' ) );
}

if ( $wp_indigo_mastodon ) {
echo sprintf( '<a href="%s" aria-label="%s" class="c-social-share__item" target="_blank"><span class=" c-social-share__icon iconify" data-icon="ri:mastodon-fill" data-inline="false"></span></a>', esc_url( $wp_indigo_mastodon ), esc_html__( 'Mastodon', 'wp-indigo' ) );
}

if ( $wp_indigo_bluesky ) {
echo sprintf( '<a href="%s" aria-label="%s" class="c-social-share__item" target="_blank"><span class=" c-social-share__icon iconify" data-icon="ri:bluesky-fill" data-inline="false"></span></a>', esc_url( $wp_indigo_bluesky ), esc_html__( 'Bluesky', 'wp-indigo' ) );
}

echo '</div>';
}
}
Expand Down