Columns in a “post”

You can achieve the same by designing the layout structure in Single.php template page. In wordpress, by default single.php is the filename which will display the single post of your blog. You just need to create the design layout as you need in this page.

How can i display in themplate file only a few post

Ok. You are toggling your display according to a $_GET parameter that you have added to the URL– this switch in your archive.php $view = ‘poster’; $mode = stripslashes( $_GET[“afisare”] ); $modes = array(‘complex’, ‘simple’, ‘poster’); if(in_array($mode, $modes)) $view = $mode; get_template_part(‘persoane’, $view); You can alter how many posts will display but that is much … Read more

How to limit post query to only return a total count of items with certain post statuses?

WHERE post_status NOT IN (‘auto-draft’,’trash’) Looks like you can add that to your base query. /* — Preparing your query — */ $query = “SELECT * FROM $wpdb->posts WHERE post_status NOT IN (‘auto-draft’,’trash’) “; This is only barely a WordPress question. Why are you not using core functions for this? Also, NOT IN is not … Read more

TinyMCE buttons broken

Solved: It appears chrome had a corrupt cache as I attempted to visit the backend on Firefox and noticed that the issue wasn’t there. I had to delete all Chrome browsing data (cache alone wouldn’t do it).

Function to retrieve a picture if there is no picture is attached

Test the value before you use it: <?php if ( ! $img = get_field(‘img_actor’, get_the_ID() ) ) $img = ‘http://www.example.com/wp-content/uploads/default.jpg’; ?> <img class=”film” src=”https://wordpress.stackexchange.com/scripts/timthumb.php?src=<?php echo urlencode($img); ?>&h=251&w=175&zc=1″ alt=”<?php the_title_attribute(); ?>” title=”<?php the_title_attribute(); ?>”/> I recommend not to use the same text for title and alt, this is very annoying for screen reader users.

loop through custom post-type with two meta_keys

You’ll need to use meta_query along with meta_(key|value|compare) to interact with two different keys and get the order you want. <?php $q = new WP_Query(array( ‘post_type’ => ‘my_project’, ‘nopaging’ => true, // same as posts_per_page => 1, ‘order’ => $order, ‘orderby’ => ‘is_featured_position’, // your position key here ‘meta_key’ => ‘is_featured_position’, // also here, see … Read more

Need Advice to Working with Custom Post Meta

If it where me id store each question as a ‘question’ type meta as a stored array. WordPress automatically serializes your array before storing it. So then when you use get_post_meta($post_id, ‘question’) it will return an array of serialized strings.(I think, Im pretty sure it wont unserialize it for you if there are more than … Read more