Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/midianinja/ninja-wp-theme
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
dioliviers committed May 8, 2024
2 parents fafef41 + 23637fd commit f676334
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 19 deletions.
8 changes: 8 additions & 0 deletions themes/midia-ninja-theme/library/blocks/includes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,14 @@ function get_coauthors_callback( $request ) {
];
}

array_unshift( $data, [
'id' => 0,
'display_name' => __( 'Select an option', 'ninja' ),
'user_nicename' => ''
] );

$data = apply_filters( 'ninja/helpers/coauthors', $data );

if ( ! empty( $data ) ) {
return new \WP_REST_Response( $data, 200 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "ninja/latest-horizontal-posts",
"version": "0.1.20",
"version": "0.1.22",
"title": "Últimos posts (Horizontal)",
"category": "text",
"icon": "excerpt-view",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export default function Edit( { attributes, setAttributes } ) {
value={ postsToShow }
onChange={ ( value ) => setAttributes( { postsToShow: value } ) }
min={ 2 }
max={ 99 }
max={ 20 }
step={ 2 }
/>
</PanelRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function latest_horizontal_posts_callback( $attributes ) {
'post__in' => $top_viewed_posts,
'post_status' => 'publish',
'post_type' => $attributes['postType'],
'posts_per_page' => $limit,
'posts_per_page' => $limit
];

if ( ! $show_children ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
.slide {
margin-bottom: 30px;
margin-top: 15px;

@include break-medium {
margin-bottom: 15px;
}
}

.slick-slide {
Expand Down Expand Up @@ -283,13 +287,14 @@
}

.slick-arrow {
background-color: #414141;
background-color: var(--wp--preset--color--secondary-light);
background-image: url("./images/slider-arrow.svg");
background-position: center;
background-repeat: no-repeat;
border-radius: 30px;
border-style: unset;
height: 30px;
opacity: .7;
padding: 0;
text-indent: -9999px;
transition: all 0.2s ease-in-out;
Expand All @@ -300,12 +305,12 @@
}

&.slick-disabled {
background-color: #414141;
opacity: .2;
pointer-events: none;
}

&:hover {
background-color: #f5f5f5;
opacity: 1;
}
}
}
Expand Down Expand Up @@ -374,7 +379,7 @@

// Most read
&.model-most-read {
background-color: var(--wp--preset--color--dark-pure);
background-color: var(--wp--preset--color--primary-dark);

&.without-title-description {
.container {
Expand Down Expand Up @@ -403,23 +408,25 @@
display: none;
}
.slide {
@media (max-width: 782px) {
width: 280px !important;
display: flex !important;
margin-left: auto;
margin-right: auto;
padding-left: 1.7rem;
}
.post {
max-width: 280px;
width: 100%;

@include break-medium {
padding-right: 15px;
}

&-content {
.post-title {
color: var(--wp--preset--color--secondary-light);
font-family: "Manrope", sans-serif;
font-size: 20px;
font-style: normal;
font-weight: 700;
line-height: 130%;

@include break-medium {
font-size: 1rem;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php $show_taxonomy = ! empty( $args['attributes']['showTaxonomy'] ) ? esc_attr( $args['attributes']['showTaxonomy'] ) : ''; ?>
<?php $show_taxonomy = isset( $args['attributes']['showTaxonomy'] ) ? $args['attributes']['showTaxonomy'] : false; ?>

<a href="<?php echo get_permalink(); ?>">
<a href="<?php echo get_permalink( $args['post']->ID ); ?>">
<div class="post">
<div class="post-content">
<?php if ( $show_taxonomy ) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ document.addEventListener("DOMContentLoaded", function() {
const dotsMobile = slider.querySelector('.medium-only .latest-horizontal-posts-block__dots')

let slidesToShowMobile = 1
if (slider.classList.contains('model-specials')) {
if (slider.classList.contains('model-specials') || slider.classList.contains('model-most-read')) {
slidesToShowMobile = 2
} else if (slider.classList.contains('model-collection') || slider.classList.contains('model-albums')) {
slidesToShowMobile = 1.5
Expand Down
2 changes: 1 addition & 1 deletion themes/midia-ninja-theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://hacklab.com.br/
Author: Hacklab
Author URI: https://hacklab.com.br/
Description: Tema base para desenvolvimento de novos sites.
Version: 1.0.11
Version: 1.0.13
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
Expand Down

0 comments on commit f676334

Please sign in to comment.