tw8sw8dw8
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Change attribute on the first post thumbnail in CategoriesI want to exclude all posts and pages. Only to change attributes on Categories, Tags, Search results and home.
Here is exactly what I do:
function show_category_posts( $query ) { if ( $query->is_main_query() ) { $query->set( 'category_name', 'blog' ); $query->set( 'posts_per_page', 20 ); } } add_action( 'pre_get_posts', 'show_category_posts' );
Then in the page template:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php endif; ?>
And the result is nothing.
If I remove the “$wp_query = new WP_Query(array…” code from the page template, there is no posts at all. The pre_get_posts function can only manipulate the posts per page. The empty (blank) /page/1000000/ still exist.
Do I miss something?I tried to use with pre_get_posts, but obviously doesn’t work because I use category page template. Could you please make an example?
Forum: Plugins
In reply to: [Yoast SEO] Clean Up Unwanted Head Links MissingYes, they also removed Google+ from social tab…
Forum: Themes and Templates
In reply to: [Hueman] Favicon in Hueman 3.0?Can I manually add <link rel=”shortcut icon” href=”<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico” /> in header.php with another 16×16 favicon?
Forum: Themes and Templates
In reply to: [Hueman] Favicon in Hueman 3.0?Is there any manual method to add also 16×16 favicon?
Forum: Themes and Templates
In reply to: [Hueman] Not work Auto update from WP Theme managerWhere can I find which files are changed on every update like here before – https://github.com/presscustomizr/hueman
Forum: Themes and Templates
In reply to: [Hueman] Add Related post into the contentHello FadingMusic,
When I copy or move this line from single.php it is only possible to put related posts above content, but I need to do after the first paragraph.
Is this possible?