a.menu_item:after {
display:block;
content: "";
width:5px;
height:5px;
border-radius:5px;
background-color: grey;
}
a.menu_item:hover:after {
background-color: red;
}
public function actionLogin()
{
if (!Yii::app()->user->isGuest)
{
$role = Yii::app()->user->role;
if ($role)
{
$this->redirect(Yii::app()->params['modules_default_pages'][$role]);
}
}
$model = new LoginForm;
// if it is ajax validation request
if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
// collect user input data
if (isset($_POST['LoginForm']))
{
$model->attributes = $_POST['LoginForm'];
if ($model->validate() && $model->login())
$this->redirect(Yii::app()->user->returnUrl);
}
$this->render('login', array('model' => $model));
}
$taxonomy_info = wp_get_post_terms(get_the_ID(), 'your_taxonomy')[0];
$current_id = get_the_ID();
$args = array(
'post_type' => 'post',
'posts_per_page'=> 8,
'tax_query'=> array(
array(
'taxonomy'=> $taxonomy_info->taxonomy,
'field'=> 'id',
'terms'=>$taxonomy_info->term_id
)
),
'post__not_in' => array($current_id),
'orderby' => 'rand'
);
$wp_query = new WP_Query($args);
if ($wp_query->have_posts()) {
while ($wp_query->have_posts()) {
$wp_query->the_post();
//....code...
}
}
Надеюсь вы понимаете, что вместо "your_taxonomy" должна быть ваша таксономия, тоже можно сказать про post_type или posts_per_page 'urlManager' => [
//...
],
'frontUrlManager' => [
'class' => 'yii\web\UrlManager',
'baseUrl' => '',
//...
]
Yii::$app->frontUrlManager->createAbsoluteUrl(['some/some', 'id'=>$id]);
public function actionPostSpecifics(){
if(Yii::$app->request->isAjax){
$model = new Post();
$model->load(Yii::$app->request->post());
$category_id = $model-> category_id;
$form = new \yii\widgets\ActiveForm;
return $this->renderAjax('form_specifics', [
'model' => $model ,
'category_id' => $category_id,
'form' => $form
]);
}
}
echo $form->field($model, 'attribute_name')->textInput();
$arr = [
[
"title"=> "Сайт1",
"link"=> "site1.ru"
],
[
"title"=> " Сайт2",
"link"=> "site2.ru"
],
[
"title"=> "Сайт2",
"link"=> "site3.ru"
]
];
<?= $form->field($model, 'email')->radioList(ArrayHelper::map($arr, 'title', 'link'),[
'item' => function($index, $label, $name, $checked, $value) {
return '<label class="modal-radio" style="display:block;">
<input type="radio" name="' . $name . '" value="' . $value . '" tabindex="3">
<i></i>
<span>' . ucwords($label) . '</span>
</label>';
}
]) ?>