Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:

- name: Install PHPCS + standards
run: |
# phpcodesniffer-composer-installer is a Composer plugin, and Composer
# refuses to run plugins that are not explicitly allow-listed. Without
# this the require aborts before PHPCS is ever installed.
composer global config --no-plugins --no-interaction \
allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --no-interaction --no-progress \
squizlabs/php_codesniffer \
phpcompatibility/php-compatibility \
Expand Down
12 changes: 10 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,16 @@ function shapely_scripts() {
// Add Bootstrap default CSS
wp_enqueue_style( 'bootstrap', $uri . '/assets/css/bootstrap.min.css', array(), '3.3.7' );

// Replace old Font Awesome with Font Awesome 6
wp_enqueue_style( 'font-awesome', $uri . '/assets/css/fontawesome6/all.min.css', array(), '6.4.2' );
/*
* Registered under a theme-specific handle rather than the generic
* 'font-awesome'. WordPress deduplicates by handle, so whichever plugin
* registers 'font-awesome' first wins and every later enqueue is silently
* a no-op. Elementor ships Font Awesome 4.7 under exactly that handle, so
* on any site running it the theme's Font Awesome 6 never loaded at all --
* and the theme's fa-brands / fa-solid classes do not exist in 4.x, which
* is why the social, search and menu icons rendered as blank boxes.
*/
wp_enqueue_style( 'shapely-font-awesome', $uri . '/assets/css/fontawesome6/all.min.css', array(), '6.4.2' );

// Add Google Fonts
wp_enqueue_style( 'shapely-fonts', 'https://fonts.googleapis.com/css?family=Raleway:100,300,400,500,600,700&display=swap', array(), null );
Expand Down
14 changes: 14 additions & 0 deletions inc/class-shapely-related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ public function get_related_posts( $post_id, $number_posts = - 1 ) {
$types = wp_get_object_terms( get_the_ID(), 'jetpack-portfolio-type', $terms_args );
$tags = wp_get_object_terms( get_the_ID(), 'jetpack-portfolio-tag', $terms_args );

/*
* These return WP_Error when the taxonomy is not registered, which
* happens whenever whatever supplied the portfolio post type is
* deactivated while its posts remain. ! empty() is true for an
* object, so without this the WP_Error was pushed straight into
* tax_query and WP_Query silently returned the wrong posts.
*/
if ( is_wp_error( $types ) ) {
$types = array();
}
if ( is_wp_error( $tags ) ) {
$tags = array();
}

$tax_query = array();

if ( ! empty( $types ) ) {
Expand Down
11 changes: 10 additions & 1 deletion inc/libraries/epsilon-framework/class-epsilon-framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,16 @@ public function customizer_enqueue_scripts() {
'row' => esc_html__( 'Row', 'shapely' ),
) );

wp_enqueue_style( 'font-awesome', EPSILON_URI . '../../assets/css/fontawesome6/all.min.css' );
/*
* Two faults here, both fixed in place (this library is vendored, not a
* submodule). EPSILON_URI already ends in .../inc/libraries/epsilon-framework/,
* so '../../' resolved to .../inc/assets/css/... -- one level short of the
* theme root, and a 404, which is why the customizer's own icons were
* missing. And the generic 'font-awesome' handle collides with the one
* Elementor and others register, making this a silent no-op on those sites.
* Reuse the theme's handle so both screens load the same file once.
*/
wp_enqueue_style( 'shapely-font-awesome', get_template_directory_uri() . '/assets/css/fontawesome6/all.min.css', array(), '6.4.2' );
wp_enqueue_style( 'epsilon-styles', EPSILON_URI . '/assets/css/style.css' );
}

Expand Down
Loading