Need an advice about comments
Need an advice about comments
Need an advice about comments
I suggest you to build your own WP_Customize_Control class that does exactly what you want. You can copy-paste the core WP_Customize_Image_Control code on your own class and modify it to fit your needs. You can follow Otto’s guide to create a new control. I personally use the Customizer API to modify the background-position CSS property … Read more
The function you mention is going to return a list of links — aren’t you just trying to get the term slug as a class? Why not do…. $terms = get_the_terms($post->ID, ‘my-category’); $more_terms = get_the_terms($post->ID, ‘another-category’); $slug_out = array(); foreach($terms as $term){ $slug_out[] = $term->slug; } foreach($more_terms as $term){ $slug_out[] = $term->slug; } echo ‘<div … Read more
You have created menu “placeholders” of sorts but you haven’t added any actual menus yet, thus you see a kind of default menu being displayed. Go to wp-admin -> Appearance -> Menus Create a menu Assign the menu to one of your menu locations Add something to the menu Save Now you should see the … Read more
Finally figured this one out! It turns out that Passenger was enabled. Alias /blog /var/www/html/wordpress <Directory /var/www/html/main-site> PassengerEnabled off DirectoryIndex index.php Options -MultiViews AllowOverride All order allow,deny allow from all </Directory>
you can allow only registered user to see your content by 1.this solution for post show only to login user class RavsPublic { function __construct() { add_action(‘pre_get_posts’, array($this, ‘try_redirect’)); } function try_redirect( $query ) { // not on home page and not login if( !is_home() && !is_user_logged_in() ){ // send them to home page wp_redirect( … Read more
You want get_term_children. function hbg_category_query( $query ) { if( $query->is_main_query() && $query->is_category()) { $categories = get_term_children(1,’category’); $categories[] = 1; // add your special category if (is_category($categories)) { $query->set( ‘posts_per_page’, 32 ); } } return $query; } add_action(‘pre_get_posts’,’hbg_category_query’); Barely tested, but I think that will work.
list first post of Child Category on Category page
You should add wp_reset_postdata after outputting your recent posts.
Just add $my_query[‘posts_per_page’] = 10; (or some other number) before query_posts call. But I’m not sure if I understand you correctly.