Exclude posts in home slider from sections

I am assuming that you are saving the slider code in slider.php file, news section code in section-news.php file and following this kind of snippets in front-page/home/index .php file get_template_part(‘slider’); get_templates_part(‘section-news’); then you can edit the slider.php file and add the new array variable $do_not_duplicate. So it is preserving the slider post IDs for future … Read more

Post Template Query with WP_Query?

If you are still stuck, one possible alternative is to get all Post ID’s by the custom post type. You could try something like this: $the_query = new WP_Query( array( ‘post_type’ => ‘my-custom-post’, ‘posts_per_page’ => -1, ) )); while ( $the_query->have_posts() ) : $the_query->the_post(); the_ID(); endwhile; It would require you creating a custom post type, … Read more

Display posts side by side with custom query

Not sure how your final html should look, but I guess it’s: <ul> <li>…</li> <li>…</li> <li>…</li> </ul> In that case, you should move the ul element outside the while loop and your code should look like this: <ul> <?php while ($agendaHome->have_posts()) { $agendaHome->the_post(); ?> <li>rest of the code goes here</li> <?php } ?> </ul> Also … Read more

Wp includes access control

Considering you got an Apache server, use this full code in the .htaccess file: # Block the include-only files. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^wp-admin/includes/ – [F,L] RewriteRule !^wp-includes/ – [S=3] RewriteRule ^wp-includes/[^/]+\.php$ – [F,L] RewriteRule ^wp-includes/js/tinymce/langs/.+\.php – [F,L] RewriteRule ^wp-includes/theme-compat/ – [F,L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / … Read more