Make wpml-config.xml. https://wpml.org/forums/topic/how-to-translate-customizer-fields/
https://wpml.org/documentation/support/language-configuration-files/
Install WPML String Translation
Follow this: https://wpml.org/documentation/getting-started-guide/translating-theme-options/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create two custom functions | |
<?php //retrive years that have posts | |
function st_get_years_having_posts( $post_type ) { | |
// get years that have posts | |
global $wpdb; | |
$date_query = "SELECT YEAR(post_date) AS year FROM {$wpdb->prefix}posts WHERE post_type = '{$post_type}' AND post_status = 'publish' GROUP BY year DESC"; | |
$years = $wpdb->get_results( $date_query ); | |
return $years; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_wp_is_mobile() { | |
static $is_mobile; | |
if ( isset($is_mobile) ) | |
return $is_mobile; | |
if ( empty($_SERVER['HTTP_USER_AGENT']) ) { | |
$is_mobile = false; | |
} elseif ( | |
strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get term link | |
* @param string $term_slug Term slug | |
* @param string $taxonomy Taxonomy slug | |
* @return string Term link | |
*/ | |
function prefix_get_term_link( $term_slug, $taxonomy ) { | |
// Check if the term exists | |
$term = term_exists( $term_slug, $taxonomy ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Collects all the default theme mods value in an array | |
* @return array All the default theme mods values | |
*/ | |
function prefix_get_theme_mods_defaults() { | |
$defaults = array( | |
// Site footer options | |
'option1' => 'value1', | |
'option2' => 'value2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
su | |
adduser username sudo | |
Then reboot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FTP credentials on plugin installation: | |
define( 'FS_METHOD', 'direct' ); | |
Pretty permalinks not working: | |
Edit /etc/apache2/apache2.conf and change: | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks | |
AllowOverride None | |
Require all granted | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************************************************/ | |
## Social share buttons. | |
/***************************************************/ | |
function sachyya_social_sharing_buttons() { | |
global $post; | |
// Show this on post only. | |
// Get current page URL | |
$shortURL = get_permalink(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( current_user_can( 'customize' ) ) { ?> | |
<div class="message"> | |
<p><?php _e( 'There are no pages available to display.', 'textdomain' ); ?></p> | |
<p><?php printf( | |
__( 'These pages can be set in the <a href="%s">customizer</a>.', 'textdomain' ), | |
admin_url( 'customize.php?autofocus[control]=showcase' ) | |
); ?> | |
</p> |
OlderNewer