Latest post on specific category and custom css

Replace the ‘#textbox’ html with the following and css: <div class=”textbox”> <div class=”textbox_left”> <p class=”txtclhome”><?php dynamicnews_display_thumbnail_index(); ?> </p> </div> <div class=”textbox_right”> <h3 class=”titlehome”><a href=”https://wordpress.stackexchange.com/questions/166010/<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a></h3> <p class=”txtclrhome”><?php the_content_limit(150, “”); ?> <a class=”morelink” href=”http://styleposts.com/?cat=41″ rel=”bookmark”><?php _e(“Read More”, ‘organicthemes’); ?></a></p> </div> </div> </div> .textbox{ overflow: hidden; } .textbox_left{ width: 60%; float: left; } … Read more

Query custom post types by meta field in a term from custom taxonomy

Assuming that the query works and you get all posts with ss_category terms (instead of those with ss_aff_category = true only), I think this should work: $args = array( ‘post_type’ => array(‘advertisers_cats’), ‘posts_per_page’ => 9, ‘tax_query’ => array( array( ‘taxonomy’ => ‘ss_category’, ‘terms’ => array(100, 101), ‘field’ => ‘term_id’, ) ), ‘meta_query’ => array( array( … Read more

Intergrate WP into website

This code will not do anything. In order to integrate WordPress into an existing website, the best way would probably be to actually install wordpress on the site! This code just pulls up the header.

Question about custom plugin

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

Display posts from another page on home page in wp-editor

I created shortcode in functions.php: add_shortcode(‘projects’, ‘projects_shortcode’); function projects_shortcode($atts){ extract(shortcode_atts(array( ‘post_type’ => ‘project’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 3, //’caller_get_posts’ => 1 ), $atts)); $args = array( ‘post_type’ => $post_type, ‘post_status’ => $post_status, ‘posts_per_page’ => $posts_per_page ); global $post; $posts = new WP_Query($args); $out=””; if ($posts->have_posts()) while ($posts->have_posts()): $posts->the_post(); $overview_image = get_field(‘small_overview_image’); $out .= ‘<div … Read more

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