Foundation modal in wordpress php loop

first, read this about query_posts. to answer your question- has_post_thumbnail() returns true or false, iterating over that in a foreach loop isn’t possible. I’ll guess that the reason why the same modal appears to be repeated is that you’re giving them all the same id, so the first one is always opened. Use the post’s … Read more

Issue in If else condition [closed]

Try to replace the following: <?php $sectyp = array( ‘meta_query’ => array( array( ‘key’ => ‘section_type’, // selecting the section type “Normal” or “Parallax” ‘value’ => ‘Parallax’ ), ), ); ?> with <?php $sectyp = get_post_meta(get_the_ID(), ‘section_type’, true); ?> and replace <?php if($sectyp) { ?> with <?php if($sectyp == “Parallax”) { ?>

Active class for my flexslider in WordPress

This code here is the problem- $(‘.slider-menu li’).on(‘click’, function(e) { e.preventDefault(); var slide_index = $(‘a’, this).attr(‘href’).substr(6) – 1; $homeSlider.flexslider(slide_index); return false; // IE9 hack }); In your html, you’re setting your IDs to slide plus the attachment ID, then telling flexslider to animate to that slide. Except flexslider is expecting a slide position (1st slide, … Read more

sort Posts by custom user filed

So, if you want to display only posts on your homepage, which interests the logged in user, you can use the pre_get_posts-Action: add_action( ‘pre_get_posts’, ‘wp123234_user_specific_loop’ ); function wp123234_user_specific_loop( $query ){ if( ! is_user_logged_in() ) //Just return, if the user is not logged in. return; if( ! $query->is_main_query() ) //If its not the main query return … Read more

how do i make this loop work

You should clean it up some more but this will fix your code: <?php get_header(); ?> <div class=”posts”><!– BLOG –> <!– Shapes on sides –> <div class=”shapes_left”> </div> <div class=”shapes_right”> </div> <?php if (is_tag()) { ?> <div id=”archive_title”> <h1><?php single_tag_title(); ?></h1> <?php }?> </div> <div id=”featured_home”> <?php $counter = 0; while ( have_posts() ) { … Read more