Compare commits

..

No commits in common. "abadb3cea2c94d98db22a76db6b18170702b148e" and "b25dce83d1913c40a8b4557e09b39a72116301c0" have entirely different histories.

5 changed files with 239 additions and 7 deletions

2
.gitignore vendored
View File

@ -28,4 +28,4 @@ node_modules/
.vscode/ .vscode/
.DS_Store .DS_Store
theme/ theme/
_gitignore*

View File

@ -18,12 +18,12 @@ get_header();
get_template_part( 'template-parts/content', get_post_type() ); get_template_part( 'template-parts/content', get_post_type() );
//the_post_navigation( the_post_navigation(
// array( array(
// 'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Anterior:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>', 'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Anterior:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>',
// 'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Següent:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>', 'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Següent:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>',
// ) )
//); );
// If comments are open or we have at least one comment, load up the comment template. // If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) : if ( comments_open() || get_comments_number() ) :

View File

@ -0,0 +1,70 @@
<?php
/**
* The section containing preview of posts from category
* depending on the call from section-featured.php or whatever
* other template calling this file
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<?php
$the_query = new WP_Query(
array(
'post_type' => 'ofisuport-ajut',
'post_per_page' => '4'
) );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<article class="">
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
<ul>
<li class="ofisuport-fund ofisuport-fund-target">
<?php the_field('os_fund_target'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-source">
<?php the_field('os_fund_source'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-field">
<?php the_field('os_fund_field'); ?>
</li>
<li class="ofisuport-fund ofisuport-funder-name">
<?php the_field('os_funder_name'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-apply-begin">
<?php the_field('os_fund_apply_begin'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-apply-end">
<?php the_field('os_fund_apply_end'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-call">
<?php the_field('os_fund_call'); ?>
</li>
<li class="ofisuport-fund ofisuport-fund-media">
<?php $media = get_field( 'os_fund_media' );
if( $media ): ?>
<a href="<?php echo $media['url']; ?>" title="<?php echo $media['tile']; ?>">
<?php echo $media['filename']; ?>
</a>
<?php endif; ?>
</li>
</ul>
</section>
</article>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php else : //if no post in query ?>
<p class="no-content"><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

View File

@ -0,0 +1,89 @@
<?php
/**
* The section containing preview of posts from category
* depending on the call from section-featured.php or whatever
* other template calling this file
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<?php
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
// var_dump( $args ); //will display everythin imported from
// get_template_part( 'template-parts/section', 'category', array('category_name' => 'news', 'post_per_page' => '3' ) );
$thiscategory = $args['category_name'];
$howmanyposts = $args['post_per_page'];
?>
<section class="category-posts <?php echo $thiscategory;?> ">
<header>
<h2>
<?php
if ( is_category() ):
single_cat_title();
else:
echo $thiscategory;
endif;
?>
</h2>
</header>
<main class="">
<?php $the_query = new WP_Query( array( 'category_name' => $thiscategory, 'posts_per_page' => $howmanyposts ) ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<article class="">
<?php if ( has_post_thumbnail() ) :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
</figure>
</a>
<?php else :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
</figure>
</a>
<?php endif;?>
<h5 class="date">
<?php
if ( is_category( 'news' ) ):
the_date('d.m.Y');
else:
the_date('Y');
endif;
?>
</h5>
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
</section>
</article>
<?php endwhile;//end of the loop ?>
</main>
<aside>
<?php //get_template_part( 'template-parts/navigation', 'prevnext' ); ?>
<nav>
<?php
// button load more simple
echo '<a class="button hollow" href="' . esc_url( get_site_url( null, $thiscategory ) ) . '">';
echo 'load more ' ;
echo $thiscategory;
echo '</a>';
?>
</nav>
</aside>
<?php wp_reset_postdata(); ?>
<?php else : //if no post in query ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
</main>
<?php endif; ?>
</section>

View File

@ -0,0 +1,73 @@
<?php
/**
* The section containing preview of resources
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<?php
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
// var_dump( $args ); //will display everythin imported from
// get_template_part( 'template-parts/section', 'category', array('category_name' => 'news', 'post_per_page' => '3' ) );
$thiscustomposttype = get_post_type( get_the_ID() );
$howmanyposts = $args['post_per_page'];
?>
<section class="archive-posts resources">
<header>
<h2>
<?php
// if ( is_post_type_archive() ):
post_type_archive_title();
// else:
// echo $thiscustomposttype;
// endif;
?>
</h2>
</header>
<main class="">
<?php $the_query = new WP_Query( array( 'post_type' => $thiscustomposttype, 'posts_per_page' => $howmanyposts ) ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<article class="">
<?php if ( has_post_thumbnail() ) :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
</figure>
</a>
<?php else :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
</figure>
</a>
<?php endif;?>
<h5 class="date">
<?php the_date('Y');?>
</h5>
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
</section>
</article>
<?php endwhile;//end of the loop ?>
<?php //pagination here if needed?>
<?php wp_reset_postdata(); ?>
<?php else : //if no post in query ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</main>
<aside>
<nav>
<!--a href="" class="button hollow">see more news</a-->
</nav>
</aside>
</section>