feat(ui): perbaiki styling form komentar modern dan tambahkan social share bar
This commit is contained in:
+29
-1
@@ -76,6 +76,35 @@ function edukarsa_register_sidebars() {
|
||||
}
|
||||
add_action( 'widgets_init', 'edukarsa_register_sidebars' );
|
||||
|
||||
// Helper Tombol Berbagi Media Sosial Native (Post & Page)
|
||||
function edukarsa_social_share() {
|
||||
$share_url = rawurlencode( get_permalink() );
|
||||
$share_title = rawurlencode( get_the_title() );
|
||||
?>
|
||||
<div class="edukarsa-share-box">
|
||||
<span class="share-box-title"><?php esc_html_e( 'Bagikan Halaman Ini:', 'edukarsa' ); ?></span>
|
||||
<div class="share-btn-group">
|
||||
<a href="https://wa.me/?text=<?php echo $share_title . '%20' . $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-wa" title="WhatsApp">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.53 1.777.82 2.796.82h.005c3.18 0 5.767-2.586 5.768-5.766 0-3.18-2.587-5.806-5.773-5.806zm3.376 8.214c-.149.42-.767.781-1.072.829-.304.048-.687.069-2.203-.559-1.933-.801-3.178-2.775-3.275-2.905-.095-.129-.778-1.036-.778-1.975 0-.94.492-1.401.667-1.593.175-.192.383-.24.512-.24.129 0 .258.006.371.012.12.006.279-.045.436.334.164.397.558 1.365.607 1.465.049.099.082.217.017.348-.065.131-.098.212-.195.328-.098.115-.205.258-.293.346-.098.098-.201.205-.087.401.115.196.512.846 1.099 1.368.756.673 1.393.882 1.59.98.196.098.312.082.426-.049.115-.131.492-.573.623-.77.131-.196.262-.164.442-.098.18.065 1.147.541 1.344.639.196.098.328.147.377.229.049.082.049.475-.1.895z"/></svg>
|
||||
<span>WhatsApp</span>
|
||||
</a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-fb" title="Facebook">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>
|
||||
<span>Facebook</span>
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/tweet?text=<?php echo $share_title; ?>&url=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-tw" title="X (Twitter)">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
||||
<span>X / Twitter</span>
|
||||
</a>
|
||||
<button type="button" class="share-pill share-pill-copy" onclick="navigator.clipboard.writeText('<?php echo esc_js( get_permalink() ); ?>'); alert('<?php echo esc_js( __( 'Tautan berhasil disalin ke clipboard!', 'edukarsa' ) ); ?>');">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
||||
<span>Salin Link</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function edukarsa_enqueue_scripts() {
|
||||
wp_enqueue_style( 'edukarsa-style', get_stylesheet_uri(), array(), time() );
|
||||
|
||||
@@ -87,7 +116,6 @@ function edukarsa_enqueue_scripts() {
|
||||
wp_enqueue_script( 'edukarsa-global-js', get_template_directory_uri() . '/assets/edukarsa.js', array(), time(), true );
|
||||
}
|
||||
|
||||
// Memuat API Google Translate dengan dependensi ke edukarsa-global-js
|
||||
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) {
|
||||
wp_enqueue_script(
|
||||
'google-translate-api',
|
||||
|
||||
Reference in New Issue
Block a user