function get_idparentcat($cat_parent){
if( $cat_parent == 0 )
{
echo $cat->term_id;
}
else
{
echo $cat_parent;
}
}
get_idparentcat($cat_parent);
function get_idparentcat($cat_parent){
echo !$cat_parent ? $cat->term_id : $cat_parent;
}
<?php if( ! empty( get_field( 'har01' ) ) ) : ?>
<tr class="tr01">
<td><img class="harimg" src="http://kosmosauto.com/wp-content/uploads/2016/02/har011.png" /> Привод:</td>
<td><?php the_field( 'har01' ); ?></td>
</tr>
<?php endif; ?>
if (this.options.pagination.active) {
i = e("<ul>", {
"class": "slidesjs-pagination"
}).appendTo(n);
e.each(new Array(this.data.total), function(t) {
var n, r;
n = e("<li>", {
"class": "slidesjs-pagination-item"
}).appendTo(i);
r = e("<a>", {
href: "#",
"data-slidesjs-item": t,
html: t + 1
}).appendTo(n);
e("<span>").appendTo(r)
return r.click(function(t) {
t.preventDefault();
a.stop(!0);
return a.goto(e(t.currentTarget).attr("data-slidesjs-item") * 1 + 1)
})
})
}
is = {
type: function (value, type) {return {}.toString.call(value).match(/ ([a-z]+)/i)[1] == type}
}
registry = {}
function API_request(method, parameters, success, error) {
if (!is.type(parameters, "Object")) {
console.error("parameters must be an object.")
return
}
var callback = "c" + String(Math.random()).slice(-6)
var flag = false
registry[callback] =
function (data) {
flag = true
delete registry[callback]
if (is.type(success, "Function")) {success(data)}
}
var URL = "https://api.vk.com/method/" + method + "?"
for (var key in parameters) {URL += key + "=" + parameters[key] + "&"}
var script = document.createElement("script")
script.src = URL + "callback=registry." + callback
script.onload = script.onerror =
function () {
if (flag) {return}
delete registry[callback]
if (is.type(error, "Function")) {error()}
}
document.head.appendChild(script)
}
API_request(
"users.get",
{
user_ids: "1,2,3",
fields: "photo_50"
},
function (response) {
for (i = 0; i < response.response.length; i++) {
img = document.createElement("img")
img.src = response.response[i].photo_50
document.body.appendChild(img)
}
},
function () {alert("An error occured. No data loaded.")}
)
table{
counter-reset:test;
}
tr:nth-child(n+3):nth-last-child(n+3) td:nth-child(7n-2):before{
counter-increment:test;
content:counter(test);
}