Compare commits
2 Commits
b25dce83d1
...
abadb3cea2
Author | SHA1 | Date |
---|---|---|
jorge | abadb3cea2 | |
jorge | cdea87ed9e |
|
@ -28,4 +28,4 @@ node_modules/
|
|||
.vscode/
|
||||
.DS_Store
|
||||
theme/
|
||||
|
||||
_gitignore*
|
||||
|
|
12
single.php
12
single.php
|
@ -18,12 +18,12 @@ get_header();
|
|||
|
||||
get_template_part( 'template-parts/content', get_post_type() );
|
||||
|
||||
the_post_navigation(
|
||||
array(
|
||||
'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>',
|
||||
)
|
||||
);
|
||||
//the_post_navigation(
|
||||
// array(
|
||||
// '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>',
|
||||
// )
|
||||
//);
|
||||
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
if ( comments_open() || get_comments_number() ) :
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
<?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; ?>
|
|
@ -1,89 +0,0 @@
|
|||
<?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>
|
|
@ -1,73 +0,0 @@
|
|||
<?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>
|
Loading…
Reference in New Issue