Commit fca6839c authored by Simonas's avatar Simonas

release 1.4.1

parent 1ca4e3f0
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
## Production ## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build` - build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.4.0 .` (update version number) - build new image `docker build -t biuro/web:1.4.1 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs` - login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.4.0` - push image to docker repository - `docker push biuro/web:1.4.1`
## Production ## Production
- update biuro/web image version in .env file (staging or www) - update biuro/web image version in .env file (staging or www)
......
{ {
"name": "biuro", "name": "biuro",
"version": "1.4.0", "version": "1.4.1",
"description": "Biuro WP theme", "description": "Biuro WP theme",
"scripts": { "scripts": {
"dev": "gulp --require @babel/register --gulpfile tasks", "dev": "gulp --require @babel/register --gulpfile tasks",
......
...@@ -568,22 +568,22 @@ add_action( 'rest_api_init', function () { ...@@ -568,22 +568,22 @@ add_action( 'rest_api_init', function () {
) )
)); ));
// register_rest_route( 'api/v1', '/contacts', array( register_rest_route( 'api/v1', '/contacts', array(
// 'methods' => WP_REST_Server::READABLE, 'methods' => WP_REST_Server::READABLE,
// 'callback' => 'Biuro_Contacts_Public::getContacts', 'callback' => 'Biuro_Contacts_Public::getContacts',
// 'args' => [ 'args' => [
// 'from' => [ 'from' => [
// 'validate_callback' => function($param, $request, $key) { 'validate_callback' => function($param, $request, $key) {
// return is_string( $param ); return is_string( $param );
// } }
// ], ],
// 'by' => [ 'by' => [
// 'validate_callback' => function($param, $request, $key) { 'validate_callback' => function($param, $request, $key) {
// return is_string( $param ); return is_string( $param );
// } }
// ] ]
// ] ]
// )); ));
}); });
......
...@@ -74,12 +74,88 @@ $date_format = get_option( 'date_format' ); ...@@ -74,12 +74,88 @@ $date_format = get_option( 'date_format' );
<?php <?php
function getPaginationURL($i) {
$pathname = preg_replace('/[?|^&]pg=\\d+/', '', $_SERVER['REQUEST_URI']);
if ($i === 1) {
return $pathname;
}
$append = '?';
if ( false !== strpos( $pathname, '?' ) ) {
$append = '&';
}
return $pathname . $append . 'pg=' . $i;
}
function getPaginationPage($i, $page) {
if ($i == $page):
echo '<span aria-current="page" class="page-numbers current">' . $i . '</span>';
else:
echo '<a class="page-numbers" href="' . getPaginationURL($i) . '">' . $i . '</a>';
endif;
}
if ( !is_front_page() ): if ( !is_front_page() ):
echo $jobs->pagination( array(
'type' => 'paginate' , $total = ceil($jobs->total_found()/$jobs->limit);
'prev_text' => ' ', $page = $jobs->page;
'next_text' => ' ' $prev = ($total > 7 && $page > 3) ? true : false;
) ); $next = ($total > 7 && $page < ($total - 3) ) ? true : false;
if ($total > 1) :
echo '<span class="pods-pagination-paginate ">';
if ($page > 1):
echo '<a class="prev page-numbers" href="' . getPaginationURL($page-1) . '"> </a>';
endif;
getPaginationPage(1, $page);
if ($prev):
echo '<a class="page-numbers dots" href="' . getPaginationURL($page-3) . '">...</a>';
endif;
if ($total < 8):
for ($i = 2; $i < $total; $i++):
getPaginationPage($i, $page);
endfor;
else:
if ($page < 4):
for ($i = 2; $i <= 5; $i++):
getPaginationPage($i, $page);
endfor;
elseif ($page > ($total - 4)):
for ($i = $total - 4; $i < $total; $i++):
getPaginationPage($i, $page);
endfor;
else:
for ($i = $page - 1; $i <= $page + 1; $i++):
getPaginationPage($i, $page);
endfor;
endif;
endif;
if ($next):
echo '<a class="page-numbers dots" href="' . getPaginationURL($page+3) . '">...</a>';
endif;
getPaginationPage($total, $page);
if ($page < $total):
echo '<a class="next page-numbers" href="' . getPaginationURL($page+1) . '"> </a>';
endif;
echo '</span>';
endif;
// echo $jobs->pagination( array(
// 'type' => 'paginate' ,
// 'prev_text' => ' ',
// 'next_text' => ' '
// ) );
endif; endif;
?> ?>
...@@ -44,7 +44,7 @@ if ( is_search()) : ...@@ -44,7 +44,7 @@ if ( is_search()) :
endif; endif;
else: elseif ( !$searchQuery['city'] || !$searchQuery['s'] ) :
?> ?>
<meta name="robots" content="noindex" /> <meta name="robots" content="noindex" />
<?php <?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment