<?php $category = get_the_category(); ?>
<div class="class" style="background:url(адрес с темой/images/papka/<?php echo $category[0]->term_id; ?>.jpg) no-repeat;"></div>
<?php foreach((get_the_category()) as $category) {
echo '<div class="class" style="background:url(http://example.com/images/papka/' . $category->cat_ID . '.jpg) no-repeat;"></div>';
} ?>
<?php
function profile_info_shortcode( $atts ) {
ob_start();
if ( is_user_logged_in() ) {
global $current_user;
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) {
update_user_meta( $current_user->ID, 'first_name', esc_attr( $_POST['first-name'] ) );
}
?>
<form method="post" id="user_page" action="<?php the_permalink(); ?>">
<label for="first-name"><?php _e( 'Имя', 'ay' ); ?></label>
<input name="first-name" type="text" id="first-name" value="<?php the_author_meta( 'first_name', $current_user->ID ); ?>" />
<input name="updateuser" type="submit" id="updateuser" value="<?php _e( 'Сохранить', 'ay' ); ?>" />
<?php wp_nonce_field( 'update-user' ) ?>
<input name="action" type="hidden" id="action" value="update-user" />
</form>
<?php
}
return ob_get_clean();
}
add_shortcode( 'profile', 'profile_info_shortcode' );
<input class="text-input" name="user_school" type="text" id="user_school" value="<?php the_author_meta( 'user_school', $current_user->ID ); ?>" />
update_user_meta( $current_user->ID, 'user_school', esc_attr( $_POST['user_school'] ) );
$('el').hover(
function(){
...
});
$('.nav-wrap > ul > li > a').hover(function(){
if ($(this).parent().hasClass("selected")) {
e.preventDefault();
$(this).parent().removeClass("selected");
return
}
else if($(this).parent().hasClass("submenu-ind")){
e.preventDefault();
}
$('.nav-wrap > ul > li').removeClass("selected");
$(this).parent().addClass("selected");
});
$('.nav-wrap > ul > li > ul').parent().addClass("submenu-ind");
$('.mob-menu-btn').hover(function() {
if($('nav').hasClass("navActive")){
$('nav').removeClass("navActive");
$('nav').slideUp();
$('.f-nav').show();
return
}
$('nav').slideDown();
$('.f-nav').hide();
$('nav').addClass("navActive");
})