add_filter( 'query_vars', 'add_query_vars' );
function add_query_vars( $qvars ) {
$qvars[] = 'filter_naznachenie';
$qvars[] = 'orderby';
return $qvars;
}
add_query_arg()
$link = get_the_permalink()
$link = add_query_arg( [ 'orderby' => 'price', 'filter_naznachenie' => 'svet' ], $link );
echo '<a href="' . $link . '"></a>';
<li>
$classes = array();
$classes[] = 'mix';
if ( $terms = get_the_terms( get_the_ID(), 'genretax' ) ) {
foreach ( $terms as $key => $term ) {
$classes[] = 'category' . $term->term_id;
}
}
echo '<li class="' . implode( ' ', $classes ) . '">';
if ( $query->have_posts() ) {
$i = 1;
while ( $query->have_posts() ) {
$query->the_post();
if ( $i == 1 ) {
get_template_part( 'templates/template-one' ); // первый
} elseif( $i == 2 ) {
get_template_part( 'templates/template-two' ); // второй
} else {
get_template_part( 'templates/template-common' ); // остальные
}
$i++;
}
} else {
// Постов не найдено
}
update_option()
$city_data = array(
'iso-area' => 'RU-MOS',
'title' => 'Москва',
'gde' => 'в Москве',
'kuda' => 'в Москву',
'otkuda' => 'из Москвы',
'chej' => 'Московский',
'chego' => 'Москвы',
'chemu' => 'Москве',
'o-chem' => 'о Москве',
'english' => 'Moscow',
'population' => '12 655 050',
'region' => 'central',
);
update_option( '_city_data', $city_data, 'yes' );
$site_data = get_option( '_site_data' );
vardump( $site_data['title'] );
$array = [ '123-345', '999-257', '399-455', '846-313', '555-000', '766-765', '564-564' ];
// создаем excel объект
$objPHPExcel = new PHPExcel();
// устанавливаем свойства excel документа
$objPHPExcel->getProperties()->setCreator("Levandovskaya Marina")
->setLastModifiedBy("Levandovskaya Marina")
->setTitle("Doc Title")
->setSubject("Doc Subject")
->setDescription("Doc Description")
->setKeywords("Doc Keywords")
->setCategory("Doc Category");
$objPHPExcel->setActiveSheetIndex(0);
// добавляем данные из массива в документ
foreach ( $array as $key => $value ) {
$objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'A' . $key, $value );
}
// сохраняем файл
$objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel2007' );
$objWriter->save( str_replace( '.php', '.xlsx', __FILE__ ) );
$letters = array();
for ( $x = 'A'; $x <= 'ZZ'; $x++ ) {
$letters[] = $x;
}
$content = '<img itemprop="url image" loading="lazy" class="vc_single_image-img attachment-large" src="data:image/svg+xml,%3Csvg%20xmlns=\'http://www.w3.org/2000/svg\'%20viewBox=\'0%200%20690%20808\'%3E%3C/svg%3E" width="690" height="808" data-lazy-sizes="(max-width: 690px) 100vw, 690px" data-lazy-src="/images/wp-content/uploads/2021/03/deklaracija-list-1.jpg">
<img itemprop="url image" loading="lazy" class="vc_single_image-img attachment-large" src="/images/wp-content/uploads/2021/03/deklaracija-list-1.jpg" width="690" height="808" data-lazy-sizes="(max-width: 690px) 100vw, 690px">';
$html = str_get_html( $content );
$images = $html->find( 'img' );
foreach ( $images as $key => $image ) {
if ( stripos( $image->src, 'data:' ) !== false ) {
$image->outertext = '';
}
}
var_dump( $html->innertext );
if ( $xlsx = SimpleXLSX::parse('book.xlsx') ) {
print_r( $xlsx->rows() );
} else {
echo SimpleXLSX::parseError();
}
if ( $xlsx = SimpleXLSX::parse('book.xlsx') ) {
print_r( $xlsx->rows() );
} else {
echo SimpleXLSX::parseError();
}