import {BrowserRouter as Router, Routes, Route, Navigate} from 'react-router-dom';
function App() {
const {getUser, user, setUser} = useUser();
return (
<Router>
<Routes>
<Route path="/" element={<LoginForm user={user} getUser={getUser}/>}/>
<Route path="login" element={<LoginForm user={user} getUser={getUser}/>}/>
<Route path="dashboard/*" element={<PrivateRoute user={user}><DashboardRoutes user={user}/></PrivateRoute>}/>
</Routes>
</Router>
);
}
export default App;
const DashboardRoutes = ({user}) => (
<Routes>
<Route path="/" element={<Dashboard user={user}/>}/>
<Route path="acts" element={<ActsPage user={user}/>}/>
</Routes>
);
const PrivateRoute = ({user, children}) => {
if(localStorage.getItem('token')) {
return children;
}
return <Navigate to="/login"/>;
}
DashboardRoutes()
можно добавлять вложенные роуты. Из вашего личного опыта, при работе к какими мониторами у вас напрягались глаза, а с какими нет?
Есть цикл который выводит блоки со ссылками внутри
<?php
$layout = $settings['layout'];
$prod_categories = get_terms( 'product_cat', $catargs );
foreach ( $prod_categories as $key => $prod_cat ):
$counter++;
$bgc++;
$cat_thumb_id = get_term_meta( $prod_cat->term_id, 'thumbnail_id', true );
$cat_thumb = wp_get_attachment_image( $cat_thumb_id, $image_size );
$term_link = get_term_link( $prod_cat, 'product_cat' );
$thumbnails = $cat_thumb;
?>
<div class="<?php echo esc_attr( $collumval ); ?>">
<?php if( '1' === $layout ): ?>
<div class="1"></div>
<?php elseif( '3' === $layout ):?>
<a>ссылка</a>
<?php endif; ?>
</div>
<?php
if( $bgc == 4 ){ $bgc = 0; }
if( $counter == $limitcount ) { break; }
endforeach;
$layout = $settings['layout'];
$prod_categories = get_terms('product_cat', $catargs);
foreach ($prod_categories as $key => $prod_cat) {
$counter++;
$bgc++;
$cat_thumb_id = get_term_meta($prod_cat->term_id, 'thumbnail_id', true);
$cat_thumb = wp_get_attachment_image($cat_thumb_id, $image_size);
$term_link = get_term_link($prod_cat, 'product_cat');
echo '<div class="' . esc_attr($collumval) . '">';
switch ($layout) {
case '1':
echo '<div class="1"></div>';
break;
case '3':
echo '<a href="' . esc_url($term_link) . '">ссылка</a>';
break;
}
echo '</div>';
if ($bgc == 4) {
$bgc = 0;
}
if ($counter == $limitcount) {
break;
}
}
if ('3' === $layout) {
echo '<div class="3"><a href="#">test</a></div>';
}
Где учить нейросети python?
Может, кто-нибудь подскажет как изучить это с полного нуля до уровня специалиста?
На сайте https://opendag.ru при открытии мобильной версии главное меню сайта уходит в бургер.
.primary-navigation-wrap
имеет стандартную видимость, а вот элемент горизонтального меню nav.site-navigation
- скрыт, и наоборот в десктопной версии..site-navigation {
display:none;
margin-top: 10px;
padding: 0
}
.site-navigation {
/* display:none; */
margin-top: 10px;
padding: 0
}
.menu-toggle {
display: block
}
.menu-toggle {
/* display: block; */
}
main-style.css?ver=6.1.1
на main-style.css?ver=6.1.2
:function theme_enqueue_styles() {
wp_enqueue_style('custom-style', get_template_directory_uri() . '/assets/dist/css/main-style.css', array(), '6.1.2');
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
Почему вебвизор пугает меня каждый раз таким уродством, как будто не видит изменения в стилях?
Есть ли какие-то санкции за использование существующих персонажей/фонов/музыки в фанатских поделках, которые вообще никак не монетизируются
и насколько велик шанс под них попасть?
А если в самой игре указывать всех авторов используемого контента?
но чет стремно на штраф влететь…
но у банка нету специального плагина для WooCommerce
Какие есть варианты, кроме написания своего плагина? Может есть что то готовое?
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of this License; and
You must cause any modified files to carry prominent notices stating that You changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
if (__DEV__) {
console.warn('Some warning message');
}
У меня есть сайт, на котором появляются товары, под каждый товар создаётся страница.
Через определенное время, этот товар может быть удалён, а поисковый робот эту страницу уже просканирует и при повторном посещении в Вебмастере и в Гугл Консоли будут ошибки о несуществующих страницах.
Как правильно настроить этот момент для SEO, чтобы не было проблем с поисковой оптимизацией ?
<?php
/**
* Plugin Name: Чумовой плагин
* Description: Это плагин, твердо и четко!
*/
if(!defined('ABSPATH')) {
exit;
}
class Best_Plugin {
protected $menu_slug = 'best-plugin';
public function __construct() {
// добавление страницы с пунктом меню
add_action('admin_menu', [$this, 'add_admin_page']);
// добавление ссылки на настройки плагина в списке плагинов
add_filter(
'plugin_action_links_' . plugin_basename(__FILE__),
[$this, 'add_settings_link']
);
}
// страница, любое содержимое страницы, обычно это винегрет из html/js/php
public function add_page() {}
// добавление страницы с пунктом меню
public function add_admin_page() {
add_options_page(
'Страница чумового плагина',
'Чумовой плагин',
'manage_options',
$this->menu_slug,
[$this, 'add_page'],
1
);
}
// добавление ссылки на настройки в списке плагинов
public function add_settings_link($links) {
$settings_link = "<a href=\"options-general.php?page={$this->menu_slug}\">Настройки чумового плагина</a>";
array_unshift($links, $settings_link);
return $links;
}
}
new Best_Plugin();
$ pm2 start app.py --name "app-name" --interpreter python3 --restart-delay 1000 --max-restarts 10
$ pm2 save
$ pm2 startup