Duplicate post problem
if( $post->ID == $do_not_duplicate ) continue; This fixed it for me
if( $post->ID == $do_not_duplicate ) continue; This fixed it for me
You need to set user logged in condition on button/ link which triggers ajax request, eg, if user is not logged in open login modal else your function.
I don’t believe the code worked what you have posted. If you simply copied and pasted it from your template, it would never have worked. There are a couple of syntax errors/bugs in your code <?php if((have_posts)): ?> should be <?php if(have_posts()): ?>. <?php $count ?> What does this mean. This is suppose to update … Read more
Like @jdm2112, I’m not a Gensis user, but here is an alternative method to retrieving the featured image. I use this method because it offers more functionality to altering the featured image (ie: thumbnail size). You can add these functions to your functions.php file. public function get_featured_image_id() { return (int) $this->get_meta( ‘_thumbnail_id’ ); } /** … Read more
For the example you posted, the article is styled according to the css rule(s) for category-selling-and-advertising which is defined last (among the category-* classes) in the article’s class attribute. You need to intercept the functionality of post_class() to change the order these classes appear. The post_class filter will do the job for you: add_filter( ‘post_class’, … Read more
This is the source of all your problems: <?php if(is_home() && !is_paged()) { ?> <?php query_posts(array(‘post__in’=>get_option(‘sticky_posts’))); ?> This takes the current query, and puts it to one side, and places a new query in its place. Here you’re saying that you want to show the first page of sticky posts. You said nothing about tags … Read more
From ACF Documentation: /* * Conditional Statement */ if( get_field(‘field_name’) ) { echo “do something”; } else { echo “do something else”; } So…to check if something is “NOT” checked is just the else of the above.
Have you tried wp_reset_query(); after each loop? Please provide complete code for your template then we may can help.
All other things being equal, your page file “page-projets.php” will display a page with a slug = “projets”. So… what is the contents of that page?
You should change your get_posts to WP_Query. You are making a lot of queries because you’re running setup_postdata is running its own set of queries to get the post data from the posts you got through get_posts. This can be avoided by using WP_Query instead. Based on your code, you should have something like this … Read more