style: PHPCS clean across theme PHP
This commit is contained in:
+6
-3
@@ -31,9 +31,11 @@ $footerNav = ! empty( $locations['footer_navigation'] )
|
|||||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||||
<?php if ( $footerLogo ) { ?>
|
<?php if ( $footerLogo ) { ?>
|
||||||
<img src="<?php echo esc_url( $footerLogo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
|
<img src="<?php echo esc_url( $footerLogo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
|
||||||
<?php } else {
|
<?php
|
||||||
|
} else {
|
||||||
echo esc_html( get_bloginfo( 'name' ) );
|
echo esc_html( get_bloginfo( 'name' ) );
|
||||||
} ?>
|
}
|
||||||
|
?>
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
<?php if ( $footerDesc ) : ?>
|
<?php if ( $footerDesc ) : ?>
|
||||||
@@ -41,7 +43,8 @@ $footerNav = ! empty( $locations['footer_navigation'] )
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php for ( $i = 1; $i <= 3; $i++ ) :
|
<?php
|
||||||
|
for ( $i = 1; $i <= 3; $i++ ) :
|
||||||
$area_id = 'footer-' . $i;
|
$area_id = 'footer-' . $i;
|
||||||
if ( ! is_active_sidebar( $area_id ) ) {
|
if ( ! is_active_sidebar( $area_id ) ) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+3
-2
@@ -11,7 +11,7 @@ get_header();
|
|||||||
|
|
||||||
$hero_heading = get_field( 'homepage_hero_heading' );
|
$hero_heading = get_field( 'homepage_hero_heading' );
|
||||||
$hero_intro = get_field( 'homepage_hero_intro' );
|
$hero_intro = get_field( 'homepage_hero_intro' );
|
||||||
$hero_cta_1 = get_field( 'homepage_hero_cta_1' ); // array( url, title, target )
|
$hero_cta_1 = get_field( 'homepage_hero_cta_1' ); // ACF link fields return shape: URL, title, target.
|
||||||
$hero_cta_2 = get_field( 'homepage_hero_cta_2' );
|
$hero_cta_2 = get_field( 'homepage_hero_cta_2' );
|
||||||
?>
|
?>
|
||||||
<section class="home-hero aura-bg">
|
<section class="home-hero aura-bg">
|
||||||
@@ -60,7 +60,8 @@ $hero_cta_2 = get_field( 'homepage_hero_cta_2' );
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $recent->have_posts() ) : ?>
|
if ( $recent->have_posts() ) :
|
||||||
|
?>
|
||||||
<div class="home-recent__grid grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
<div class="home-recent__grid grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
<?php
|
<?php
|
||||||
while ( $recent->have_posts() ) :
|
while ( $recent->have_posts() ) :
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ namespace KsPortfolio;
|
|||||||
get_header();
|
get_header();
|
||||||
|
|
||||||
$queried = get_queried_object();
|
$queried = get_queried_object();
|
||||||
$title = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Projects', 'ks-portfolio' );
|
$term_name = $queried && ! is_wp_error( $queried ) ? $queried->name : __( 'Projects', 'ks-portfolio' );
|
||||||
?>
|
?>
|
||||||
<section class="archive-projects aura-bg">
|
<section class="archive-projects aura-bg">
|
||||||
<div class="aura-bg__content">
|
<div class="aura-bg__content">
|
||||||
<div class="container mx-auto my-section">
|
<div class="container mx-auto my-section">
|
||||||
<header class="archive-projects__head">
|
<header class="archive-projects__head">
|
||||||
<h1 class="archive-projects__title"><?php echo esc_html( $title ); ?></h1>
|
<h1 class="archive-projects__title"><?php echo esc_html( $term_name ); ?></h1>
|
||||||
<p class="archive-projects__intro">
|
<p class="archive-projects__intro">
|
||||||
<a class="archive-projects__back-link" href="<?php echo esc_url( get_post_type_archive_link( 'projects' ) ); ?>">
|
<a class="archive-projects__back-link" href="<?php echo esc_url( get_post_type_archive_link( 'projects' ) ); ?>">
|
||||||
<?php echo esc_html__( '← All Projects', 'ks-portfolio' ); ?>
|
<?php echo esc_html__( '← All Projects', 'ks-portfolio' ); ?>
|
||||||
|
|||||||
@@ -14,34 +14,34 @@ if ( ! isset( $post ) || ! ( $post instanceof \WP_Post ) ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_id = (int) $post->ID;
|
$project_id = (int) $post->ID;
|
||||||
$type_label = '';
|
$type_label = '';
|
||||||
$type_terms = get_the_terms( $post_id, 'project-type' );
|
$type_terms = get_the_terms( $project_id, 'project-type' );
|
||||||
if ( ! empty( $type_terms ) && ! is_wp_error( $type_terms ) ) {
|
if ( ! empty( $type_terms ) && ! is_wp_error( $type_terms ) ) {
|
||||||
$type_label = strtoupper( $type_terms[0]->name );
|
$type_label = strtoupper( $type_terms[0]->name );
|
||||||
}
|
}
|
||||||
$release_url = Projects::get_release_url( $post_id );
|
$release_url = Projects::get_release_url( $project_id );
|
||||||
$repo_url = Projects::get_repo_browse_url( $post_id );
|
$repo_url = Projects::get_repo_browse_url( $project_id );
|
||||||
$repo_data = Projects::get_repo_data( $post_id );
|
$repo_data = Projects::get_repo_data( $project_id );
|
||||||
$language = is_array( $repo_data ) && ! empty( $repo_data['language'] ) ? (string) $repo_data['language'] : '';
|
$language = is_array( $repo_data ) && ! empty( $repo_data['language'] ) ? (string) $repo_data['language'] : '';
|
||||||
$stars = is_array( $repo_data ) && isset( $repo_data['stargazers_count'] ) ? (int) $repo_data['stargazers_count'] : 0;
|
$stars = is_array( $repo_data ) && isset( $repo_data['stargazers_count'] ) ? (int) $repo_data['stargazers_count'] : 0;
|
||||||
$excerpt = has_excerpt( $post_id ) ? get_the_excerpt( $post_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
|
$excerpt = has_excerpt( $project_id ) ? get_the_excerpt( $project_id ) : wp_trim_words( wp_strip_all_tags( $post->post_content ), 30, '…' );
|
||||||
$card_classes = 'project-card group';
|
$card_classes = 'project-card group';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $post_id ); ?>-title">
|
<article class="<?php echo esc_attr( $card_classes ); ?>" aria-labelledby="project-<?php echo esc_attr( (string) $project_id ); ?>-title">
|
||||||
<header class="project-card__head">
|
<header class="project-card__head">
|
||||||
<?php if ( $type_label ) : ?>
|
<?php if ( $type_label ) : ?>
|
||||||
<span class="project-card__type"><?php echo esc_html( $type_label ); ?></span>
|
<span class="project-card__type"><?php echo esc_html( $type_label ); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<span class="project-card__provider" aria-hidden="true">
|
<span class="project-card__provider" aria-hidden="true">
|
||||||
<?php echo esc_html( Projects::get_provider_label( $post_id ) ); ?>
|
<?php echo esc_html( Projects::get_provider_label( $project_id ) ); ?>
|
||||||
</span>
|
</span>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<h3 id="project-<?php echo esc_attr( (string) $post_id ); ?>-title" class="project-card__title">
|
<h3 id="project-<?php echo esc_attr( (string) $project_id ); ?>-title" class="project-card__title">
|
||||||
<a class="project-card__title-link" href="<?php echo esc_url( get_permalink( $post_id ) ); ?>">
|
<a class="project-card__title-link" href="<?php echo esc_url( get_permalink( $project_id ) ); ?>">
|
||||||
<?php echo esc_html( get_the_title( $post_id ) ); ?>
|
<?php echo esc_html( get_the_title( $project_id ) ); ?>
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ $card_classes = 'project-card group';
|
|||||||
|
|
||||||
<div class="project-card__actions">
|
<div class="project-card__actions">
|
||||||
<?php if ( $release_url ) : ?>
|
<?php if ( $release_url ) : ?>
|
||||||
<a class="project-card__action project-card__action--primary" href="<?php echo esc_url( Projects::get_download_url( $post_id ) ); ?>" rel="nofollow">
|
<a class="project-card__action project-card__action--primary" href="<?php echo esc_url( Projects::get_download_url( $project_id ) ); ?>" rel="nofollow">
|
||||||
<?php echo esc_html__( 'Download', 'ks-portfolio' ); ?>
|
<?php echo esc_html__( 'Download', 'ks-portfolio' ); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace KsPortfolio;
|
namespace KsPortfolio;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="aura-bg" aria-hidden="true">
|
<div class="aura-bg" aria-hidden="true">
|
||||||
<div class="aura-layer-1"></div>
|
<div class="aura-layer-1"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user