How to query post into a complex slider

I figured it out <?php $args = array( ‘post_type’ => array(‘post’, ‘music-videos’), ‘posts_per_page’ => 5, ‘orderby’ => ‘menu_order post_date’, ); $loop = new WP_Query( $args ); ?> <div id=”example1″ class=”slider-pro”> <div class=”sp-slides”> <div class=”sp-thumbnails” > <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class=”sp-slide”> <div class=”sp-image”> <a href=”https://wordpress.stackexchange.com/questions/181352/<?php the_permalink() ?>” title=”<?php the_title_attribute(); ?>”> <?php … Read more

How to query images from a post to use in a slider

Your second arg “p = 107” isn’t valid. What you could try is the get_attached_media() function. And do something like this: $media = get_attached_media(‘image’, 2360); foreach ($media as $m) { echo ‘<li>’; echo wp_get_attachment_image( $m->ID, ‘home-slider’ ); echo ‘</li>’; }

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”) { ?>

Set Transient on CPT

Submitting a full blown answer now that we’ve figured it out. Transients can be hard to troubleshoot because if you save the wrong value to the database at first, you can be looking at an old—and bad—value, even if the code that sets your transient is now correct. The two ways you can fix this … Read more

Query post Pagination Problem

I go the solution. I have take variable name like $wp_query = new WP_Query($arr); instate of $the_query = new WP_Query($arr); So my working code should be <div id=”primary” class=”content-area”> <main id=”main” class=”site-main” role=”main”> <?php // global $wp_query; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $arr = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 3, ‘paged’ => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)