<?php
if (empty($wp)) {
require_once('wp-config.php');
}
global $wpdb;
$posts = $wpdb->get_results(
"SELECT
p.ID, p.post_name
FROM
wp_posts p
WHERE
p.post_type = 'post' AND p.post_status = 'publish'");
$double = array();
$rewrite = array();
foreach($posts as $post){
if (!array_key_exists($post->post_name,$double)){
$double[$post->post_name] = 0;
}else{
$double[$post->post_name] += 1;
$rewrite[$post->ID] = $post->post_name . "-" . $double[$post->post_name];
}
}
foreach($rewrite as $key => $value){
$wpdb->update( 'wp_posts',
array( 'post_name' => $value ),
array( 'ID' => $key )
);
}
function create_post_type() {
$labels = array(
'name' => 'Projects',
'singular_name' => 'Project',
'menu_name' => 'Projects',
'name_admin_bar' => 'Project',
'add_new' => 'Add New',
'add_new_item' => 'Add New Project',
'new_item' => 'New Project',
'edit_item' => 'Edit Project',
'view_item' => 'View Project',
'all_items' => 'All Projects',
'search_items' => 'Search Projects',
'parent_item_colon' => 'Parent Project',
'not_found' => 'No Projects Found',
'not_found_in_trash' => 'No Projects Found in Trash'
);
$args = array(
'labels' => $labels,
'public' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'show_in_menu' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-appearance',
'capability_type' => 'post',
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
'has_archive' => true,
'rewrite' => array( 'slug' => 'projects' ),
'query_var' => true
);
register_post_type( 'sm_project', $args );
}
function create_taxonomies() {
// Add a taxonomy like categories
$labels = array(
'name' => 'Types',
'singular_name' => 'Type',
'search_items' => 'Search Types',
'all_items' => 'All Types',
'parent_item' => 'Parent Type',
'parent_item_colon' => 'Parent Type:',
'edit_item' => 'Edit Type',
'update_item' => 'Update Type',
'add_new_item' => 'Add New Type',
'new_item_name' => 'New Type Name',
'menu_name' => 'Types',
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'type' ),
);
register_taxonomy('sm_project_type',array('sm_project'),$args);
// Add a taxonomy like tags
$labels = array(
'name' => 'Attributes',
'singular_name' => 'Attribute',
'search_items' => 'Attributes',
'popular_items' => 'Popular Attributes',
'all_items' => 'All Attributes',
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => 'Edit Attribute',
'update_item' => 'Update Attribute',
'add_new_item' => 'Add New Attribute',
'new_item_name' => 'New Attribute Name',
'separate_items_with_commas' => 'Separate Attributes with commas',
'add_or_remove_items' => 'Add or remove Attributes',
'choose_from_most_used' => 'Choose from most used Attributes',
'not_found' => 'No Attributes found',
'menu_name' => 'Attributes',
);
$args = array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'attribute' ),
);
register_taxonomy('sm_project_attribute','sm_project',$args);
}
String str1 = "...";
String str2 = "...";
String str3 = "...";
String myString = str1 + str2 + str3;
На wordpress сейчас можно сделать любой сайт?
Боюсь, что на wordpress будет проблематично масштабировать.
switch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//проверяем свитчер если он активен, то окно с датой появляется
if (isChecked){
DatePlain.setVisibility(View.VISIBLE);
} else {
DatePlain.setVisibility(View.GONE);
}
}
});
"в четвертом классе, во втором"
#header-section .container, #hospitals, #hospitals .icon, #houzez-gmap-main, #houzez-listing-map,
#houzez-listing-map-vc, #houzez_ajax_container .map-notfound, #libraries, #libraries .icon, #listing-
map, #pharmacies, #pharmacies .icon, #schools, #schools .icon, #section-body, #section-body.houzez-
body-half .property-listing, #singlePropertyMap, #splash-section, #splash-section .splash-inner-content,
#supermarkets, #supermarkets .icon, #transportation, #transportation .icon, .accord-block .accord-tab,
.account-action, .account-action .user-image, .account-dropdown>ul, .account-dropdown>ul>li, .actions
li, .add-title-tab, .add-title-tab .add-expand:before, .advanced-search, .advanced-search-mobile,
.advanced-search-mobile .advance-fields, .advanced-search-mobile .single-search, .agent-info-block
.agent-thumb, .agent-media .media-left, .agent-media .next-prev-block .media-right, .agents-block,
.auto-complete .media, .banner-module, .banner-module .owl-item, .banner-parallax, .banner-search-
main .form-group .bootstrap-select.open, .banner-search-main .gform_wrapper li .bootstrap-select.open,
.banner-search-tabs .search-tab-inner, .banner-slider .banner-link, .banner-video, .board-header, .board-panel-menu, .board-panel-menu>li, .board-panel-menu>li a, .bypostauthor, .caption-bottom .detail-bottom, .class-energy, .class-energy-indicator, .comments-block .media-body .reply .fa, .compare-thumb-main .compare-thumb, .dashboard-content-area, .detail-bar .detail-content-tabber, .detail-media,
.detail-media #gallery, .detail-slider-nav-wrap .item, .detail-sub-title, .detail-top, .detail-top .tab-
content, .detail-top.detail-top-full .container, .detail-top.detail-top-full .header-detail .actions, .detail-
top.detail-top-full .label, .detail.detail-bottom, .figure-block, .file-upload-block, .footer .read .fa, .footer-
widget.widget_search form div, .gallery-area, .gallery-area .gallery-inner, .gallery-item, .gallery-thumb,
.gallery-thumb img, .gform_wrapper .banner-search-main li .bootstrap-select.open, .gform_wrapper
.widget-calculate li, .gform_wrapper .widget-change .body-inner>.button, .grid-view .property-item-v2
.body-inner, .grid-view .property-item-v2 .item-body-bottom, .grid-view .property-item-v2 .item-body-
top, .header-detail .label-wrap, .header-media, .header-media-wrap, .header-mobile>.container, .header-
section, .header-section .logo img, .header-section-1.nav-right .container, .header-section-1.nav-right
.header-left, .header-section-2, .header-section-3, .header-section-4, .header-section-4 .logo img, .header-section-4.nav-right .container, .header-section-4.nav-right .header-left, .header-section-5, .ihf-
share-btn-more .fa-share, .input-icon, .input-icon input, .item-body .table-cell, .item-thumb, .lightbox-
arrow, .lightbox-header, .lightbox-left, .lightbox-popup, .lightbox-popup .popup-inner, .list-search form,
.loader-ripple, .location-block, .map-info-box, .media-tabs-list li, .mobile-nav .nav-dropdown li, .mobile-
nav .nav-dropdown ul, .mobile-nav .nav-trigger, .msg-type-block, .my-property .my-actions, .navi>ul
.sub-menu li, .navi>ul>li, .next-prev-block .agent-media .media-right, .package-block, .parallax-
properties-media, .partner-block, .plan-tabs li, .print-banner .print-main-image, .profile-detail-block
.profile-image, .property-item-v2 .item-body, .property-item-v2.item-grid .body-inner, .property-item-
v2.item-grid .item-body-bottom, .property-item-v2.item-grid .item-body-top, .property-item.item-grid,
.property-item.item-grid .phone, .rating-container .caption .label, .rating-container .rating, .rating-wrap,
.saved-search-list .saved-search-block, .search-expand-btn, .search-location, .services-module .service-
block, .single-input-search, .splash-header.nav-right .container, .splash-header.nav-right .header-left,
.splash-search, .steps-progress-main .steps-progress span, .sticky_nav .header-transparent, .team-block,
.top-bar, .top-bar .top-bar-left, .top-bar .top-bar-right, .top-contact .top-bar-contact .fa, .top-contact
.top-bar-phone .fa, .top-drop-downs>li, .user-dashboard-right, .video-block, .widget-calculate .form-
group, .widget-calculate .gform_wrapper li, .widget-categories a, .widget-categories li, .widget-change
.body-inner>.btn, .widget-change .body-inner>.gform_button, .widget-change .gform_wrapper .body-
inner>.button, .widget-change .gform_wrapper .gform_page_footer .body-
inner>.button.gform_next_button, .widget-pages a, .widget-pages li, .widget_archive a, .widget_archive
li, .widget_categories a, .widget_categories li, .widget_houzez_twitter .owl-theme .owl-nav [class*=owl-],
.widget_meta a, .widget_meta li, .widget_nav_menu a, .widget_nav_menu li, .widget_pages a,
.widget_pages li, .widget_recent_comments a, .widget_recent_comments li, .widget_recent_entries a,
.widget_recent_entries li, .widget_search form div, figure {
position: relative;
}
LocalDate dateInit = LocalDate.of(2018, 1, 1);
while (dateInit.getYear() != 2030) {
if (dateInit.getDayOfWeek() == DayOfWeek.FRIDAY && dateInit.getDayOfMonth() == 13) {
System.out.println(dateInit.toString());
}
dateInit = dateInit.plusDays(1);
}