function filter_ptags_on_images($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'filter_ptags_on_images');
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
Star[] stars = new Star[4];
stars[0] = new Star(0, 0);
stars[1] = new Star(1, 0);
stars[2] = new Star(0, 1);
stars[3] = new Star(1, 1);
System.out.println(Arrays.toString(stars));
}
static class Star {
int x;
int y;
public Star(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public String toString() {
return "Star{" +
"x=" + x +
", y=" + y +
'}';
}
}
}
[Star{x=0, y=0}, Star{x=1, y=0}, Star{x=0, y=1}, Star{x=1, y=1}]
function js_includer() {
wp_register_script('your_js_id', get_stylesheet_directory_uri().'your_js.js'); //<-- Путь, если js файл в корне темы. Уточните возврат функции, возможно перед your_js.js нужен "слеш".
wp_enqueue_script('your_js_id');
}
add_action( 'admin_enqueue_scripts', 'js_includer' ); add_action( 'wp_enqueue_scripts', 'js_includer' );
jQuery(document).ready(function(){
var replaced = jQuery("body").html().replace('о','е');
jQuery("body").html(replaced);
});
БЕЗ ПЛАГИНА.
'menu' => 'Primary',
, в wp_nav_menu( $args )
нужно поменять значение на 'menu' => 'menu-1',
.<?php
$args = array(
'theme_location' => 'Primary',
'menu' => 'menu-1',
'container' => 'ul',
'container_class' => '',
'container_id' => '',
'menu_class' => '',
'menu_id' => 'nav4',
'echo' => 'false',
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '%3$s',
'depth' => 0,
'walker' => '',
);
wp_nav_menu( $args );?>