Post images not displaying as attachments

Try query post instead of $attachments = get_posts($args); or do it like <?php $args = array( ‘posts_per_page’ => 5, ‘offset’=> 1, ‘category’ => 1 ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/113158/<?php the_permalink(); ?>”><?php the_title(); ?></a> </li> <?php endforeach; wp_reset_postdata();?> also check this … Read more

Tag URLs load a single post

G.M.’s comment was correct – this was a plugin issue. A legacy pagination plugin (“Multipage Toolkit”) I’d replaced from the old install was hijacking permalinks. The plugin was no longer necessary as WP supports pagination natively. I removed the old plugin, reset permalinks again, and all was well.

How to access User meta data within a plugin

Please look at the last two lines of code. I am trying to print the id of the user. It works when used in the theme files but not inside the plugin. //Test Usermeta $user = get_userdatabylogin(‘vijay’); echo $user->ID; // prints the id of the user; In PHP, you cannot (normally) execute a user function … Read more

How do I create a sticky sidebar?

I did not really understand your question, but try this (using bootstrap v3): <div class=”clearfix”> <?php $a = 0; $classes = array(‘post-1′,’post-2′,’post-3’); query_posts(‘category_name=Menucard’); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=”<?php echo $classes[$a]; ?> col-4 post move pull-left”> <?php //echo post here the_content(); ?> </div> <!– close … Read more