function shortcode_function() {
ob_start();
$args = array(
'numberposts' => 5,
'category' => 0,
'orderby' => 'date',
'order' => 'DESC',
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'movies',
'suppress_filters' => true,
);
$posts = get_posts( $args );
$cont = 0;
foreach( $posts as $post ){
setup_postdata($post);
?>
<li><a href="<?php echo $post->guid; ?>"><?php echo $post->post_title; ?></a></li>
<?php }
$cont = ob_get_clean();
return $cont;
}
add_shortcode( 'show_films', 'shortcode_function' );
/* Internet Explorer 10+, Microsoft Edge Browser */
_:-ms-lang(x), .my-auto {
margin-top:100px !important;
}
<link href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" rel="stylesheet"/>
<form method="POST" name="f" id="form" action="" onsubmit="return false;">
<p><input type="text" placeholder="Name" name="name" oninput="InputName(this.value)"><i class="fas fa-check-circle" id="circle-ok-1"></i></p>
<p><input type="email" placeholder="Email" name="email" oninput="InputEmail(this.value)"><i class="fas fa-check-circle" id="circle-ok-2"></i></p>
<p><input type="tel" placeholder="Phone" name="phone" oninput="InputPhone(this.value)"><i class="fas fa-check-circle" id="circle-ok-3"></i></p>
<p><textarea placeholder="Message" name="message" id="form-control" rows="3" oninput="Textarea(this.value)"></textarea><i class="fas fa-check-circle" id="circle-ok-4"></i></p>
<label id="sending">Sending...</label>
<input type="submit" value="Send Message" onclick="sendForm(); return false;" />
</form>
function InputName(value) {
if (value != '') {
document.getElementById("circle-ok-1").style.display = "block";
} else {
document.getElementById("circle-ok-1").style.display = "none";
}
}
function InputEmail(value) {
let email = value;
if (email.length > 0 && (email.match(/.+?\@.+/g) || []).length !== 1) {
document.getElementById("circle-ok-2").style.display = "none";
} else {
document.getElementById("circle-ok-2").style.display = "block";
}
}
function InputPhone(value) {
let regExp = /^[+]*[(]{0,1}[0-9]{1,3}[)]{0,1}[-\s\./0-9]*$/g;
var phone = value.match(regExp);
if (phone) {
document.getElementById("circle-ok-3").style.display = "block";
} else {
document.getElementById("circle-ok-3").style.display = "none";
}
}
function Textarea(value) {
if (value != '') {
document.getElementById("circle-ok-4").style.display = "block";
} else {
document.getElementById("circle-ok-4").style.display = "none";
}
}
function sendForm() {
document.getElementById("sending").style.opacity = 1;
}
form {
width: 1100px;
max-width: 100%;
}
form input,
form textarea {
box-sizing: border-box;
width: 100%;
background: transparent;
border: 1px solid #8e908f;
padding: 10px;
font-size: 20px;
}
form p {
position: relative;
}
form p i.fas {
position: absolute;
right: 15px;
top: 15px;
display: none;
}
form p .fa-check-circle:before {
color: green;
}
form textarea {
height: 100px;
}
form input:focus,
form textarea:focus {
outline-color: #ffc300;
}
form input {
height: 50px;
}
form input[type="submit"] {
border: none;
background-color: #bb9300;
color: #000;
text-transform: uppercase;
font-weight: bold;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
form input[type="submit"]:hover {
background-color: #ffc300;
cursor: pointer;
-webkit-transition: opacity 300ms ease-out;
transition: opacity 300ms ease-out;
}
form ::placeholder {
color: #8e908f;
}
#sending {
display: block;
text-align: center;
padding: 15px;
font-size: 16px;
color: #8e908f;
opacity: 0;
}
$_SERVER['HTTPS']='on';
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ https://yourdomain.by%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP:X-SSL-Emu} !on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
For getting the current pagination number on a static front page (Page template) you have to use the 'page' query variable: Ссылка на источник
if ( is_front_page() ) {
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
} else {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
}
<span class="dashicons-before folder"><?php
$categories = get_the_terms( $post->ID, APP_TAX_CAT );
foreach ($categories as $category) {
if(!$category->parent)
{
echo "<a href='/ad-category/".urlencode(mb_strtolower($category->name)). "/' rel='tag' class='cp-fixed-color'>". $category->name. "</a>";
}
}
?></span>
$args = array(
'post_type' => APP_POST_TYPE,
'ignore_sticky_posts' => true,
'meta_query' => array(
'relation' => 'AND',
array('key' => 'cp_category',
'value' => 'Шины',
'compare' => '!='
),
array('key' => 'cp_new',
'compare' => 'NOT EXISTS'
)
),
);
$categories = get_posts( $args );
<?php if (is_single()) { ?>
<meta property="og:type" content="article" />
<?php } else { ?>
<meta property="og:type" content="website" />
<?php } ?>
<meta property="og:url" content="<?php the_permalink(); ?>">
var checkbox="";
var keys = Object.keys(form['checkbox_name[]']);
keys.forEach(function(item) {
checkbox += (form['checkbox_name[]'][item]+', ');
});
<div class="yellow"></div>
<div class="col-full">
<table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0">
<thead>
<tr>
<th class="product-thumbnail">
<h1 class="entry-title">Корзина</h1>
</th>
<th class="product-name">Обработка заказов производится<br>с 09:00 до 18:00</th>
<th class="product-subtotal">Итого</th>
<th class="product-remove"><button>Оформить заказ</button></th>
</tr>
</thead>
<tbody>
<tr class="woocommerce-cart-form__cart-item cart_item">
<td class="product-thumbnail">
thumbnail
</td>
<td class="product-name" data-title="Товар">
Товар
</td>
<td class="product-subtotal" data-title="Итого">
Итого
</td>
<td class="product-remove">
Удалить эту позицию</td>
</tr>
</tbody>
</table>
</div>
.col-full {
position:relative;
z-index:999;
width: 980px;
margin-right:50px;
margin-left:50px;
}
.yellow {
position: absolute;
width: 100%;
height: 82px;
background-color: yellow;
z-index: 1;
}
thead {
background-color:yellow;
}
add_action( 'init', 'jk_remove_storefront_header_search' );
function jk_remove_storefront_header_search() {
remove_action( 'storefront_header', 'storefront_product_search', 40 );
}
add_action('init','removeOldFunction');
function removeOldFunction(){
remove_action( 'template_redirect', 'alienship_nice_search_redirect' );
}