Skip to content

Commit

Permalink
Merge pull request #186 from LezWatch/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Ipstenu authored Sep 1, 2023
2 parents a551fe9 + 841ba28 commit 20080fc
Show file tree
Hide file tree
Showing 17 changed files with 650 additions and 429 deletions.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
last 2 versions
>1%
maintained node versions
not dead
25 changes: 10 additions & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function(grunt) {
grunt.initConfig({

// js minification
uglify: {
terser: {
dist: {
files: {
// admin scripts
Expand Down Expand Up @@ -68,40 +68,35 @@ module.exports = function(grunt) {
},
general_js: {
files: 'inc/js/*.js',
tasks: ['uglify'],
tasks: ['terser'],
options: {
spawn:false,
event:['all']
},
},
},


// Autoprefixer for our CSS files
postcss: {
options: {
map: true,
processors: [
require('autoprefixer-core')({
browsers: ['last 2 versions']
})
]
processors: require('autoprefixer')
},
dist: {
src: [ 'style*.css' ]
}
},

});


// load tasks
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-terser');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-postcss'); // CSS autoprefixer plugin (cross-browser auto pre-fixes)
grunt.loadNpmTasks('grunt-composer'); // Composer updates
grunt.loadNpmTasks('@lodder/grunt-postcss'); // CSS autoprefixer plugin (cross-browser auto pre-fixes)
grunt.loadNpmTasks('grunt-composer'); // Composer updates

// register task
grunt.registerTask('update', [
Expand All @@ -110,19 +105,19 @@ module.exports = function(grunt) {

// register task
grunt.registerTask('mika', [
'uglify',
'terser',
'sass',
'cssmin',
'postcss',
]);

// register task
grunt.registerTask('default', [
'uglify',
'terser',
'sass',
'cssmin',
'postcss',
'watch',
]);

};
};
27 changes: 23 additions & 4 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,27 @@
// Use the Gravatar.
$icon .= get_avatar( get_the_author_meta( 'user_email' ) );

// Get author's website URL.
$user_twitter = get_the_author_meta( 'twitter' );
// Get author's Socials
$user_socials = array(
'bluesky' => get_the_author_meta( 'bluesky' ),
'mastodon' => get_the_author_meta( 'mastodon' ),
'instagram' => get_the_author_meta( 'instagram' ),
'tiktok' => get_the_author_meta( 'tiktok' ),
'tumblr' => get_the_author_meta( 'tumblr' ),
'twitter' => get_the_author_meta( 'twitter' ),
'website' => get_the_author_meta( 'url' ),
);

// Get all the stupid social...
$bluesky = ( ! empty( $user_socials['bluesky'] ) ) ? '<a href="' . $user_socials['bluesky'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'bluesky.svg', 'fa-instagram' ) . '</a>' : false;
$instagram = ( ! empty( $user_socials['instagram'] ) ) ? '<a href="https://instagram.com/' . $user_socials['instagram'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'instagram.svg', 'fa-instagram' ) . '</a>' : false;
$twitter = ( ! empty( $user_socials['twitter'] ) ) ? '<a href="https://twitter.com/' . $user_socials['twitter'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'twitter.svg', 'fa-twitter' ) . '</a>' : false;
$tumblr = ( ! empty( $user_socials['tumblr'] ) ) ? '<a href="' . $user_socials['tumblr'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'tumblr.svg', 'fa-tumblr' ) . '</a>' : false;
$website = ( ! empty( $user_socials['website'] ) ) ? '<a href="' . $user_socials['website'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'home.svg', 'fa-home' ) . '</a>' : false;
$mastodon = ( ! empty( $user_socials['mastodon'] ) ) ? '<a href="' . $user_socials['mastodon'] . '" target="_blank" rel="nofollow">' . ( new LWTV_Functions() )->symbolicons( 'mastodon.svg', 'fa-mastodon' ) . '</a>' : false;

$social_array = array( $website, $twitter, $instagram, $tumblr, $bluesky, $mastodon );
$social_array = array_filter( $social_array );

// Get author Fav Shows.
$all_fav_shows = get_the_author_meta( 'lez_user_favourite_shows' );
Expand All @@ -30,8 +49,8 @@
$fav_title = _n( 'Show', 'Shows', count( $show_title ) );
}

// Add Twitter if it's there.
$archive_details .= ( ! empty( $user_twitter ) ) ? '<div class="author-twitter">' . lwtv_symbolicons( 'twitter.svg', 'fa-twitter' ) . '&nbsp;<a href="https://twitter.com/' . $user_twitter . '" target="_blank" rel="nofollow">@' . $user_twitter . '</a> </div>' : '';
// Add Socials.
$archive_details .= '<div class="author-socials">' . implode( ' ', $social_array ) . '</div>';

// Add favourite shows if they're there.
$archive_details .= ( isset( $favourites ) && ! empty( $favourites ) ) ? '<div class="author-favourites">' . lwtv_symbolicons( 'tv-hd.svg', 'fa-tv' ) . '&nbsp;Favorite ' . $fav_title . ': ' . $favourites . '</div>' : '';
Expand Down
21 changes: 19 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ function yks_excerpt_more( $more ) {
}
add_filter( 'excerpt_more', 'yks_excerpt_more' );

/**
* Filter the except length to 20 words.
*
* @param int $length Excerpt length.
* @return int (Maybe) modified excerpt length.
*/
function lwtv_custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'lwtv_custom_excerpt_length', 999 );

/**
* Widgets
*/
Expand Down Expand Up @@ -324,8 +335,14 @@ function yikes_starter_widgets_init() {
* Bootstrap Stuff
*/
// Navigation Walker.
require_once 'inc/wp_bootstrap_navwalker.php';
// require_once 'inc/class-wp-bootstrap-navwalker.php';
/**
* Register Custom Navigation Walker
*/
function register_navwalker(){
require_once 'inc/class-wp-bootstrap-navwalker.php';
// require_once 'inc/wp_bootstrap_navwalker.php';
}
add_action( 'after_setup_theme', 'register_navwalker' );

/*
* Pagination
Expand Down
Loading

0 comments on commit 20080fc

Please sign in to comment.