Articles of posts

older blog posts not showing in new theme

I have a new, custom theme that I’ve uploaded on a pre-existing site/blog. Everything seems to be working ok, with the exception of the older blog posts not showing up. Any ideas what I can do to fix? <?php get_header();?> <div id=”blog-container”> <?php get_sidebar( ‘blog’);?> <div class=”content”> <?php if(have_posts()) : while(have_posts()) : the_post(”); ?> <div […]

getting “Object of class WP_Post could not be converted to string” – when it is a string

I have the following code in my functions.php, which executes a script upon publish: function save_new_post($post_ID) { $site_root = ‘/home/forexmag/public_html/directory2’; $post = get_post($post_ID); $title = $post->post_title; $breaking_news = false; $categories = get_the_category($post_ID); if (is_array($categories) && !empty($categories)) { foreach ($categories as $cat_det) { //this is the id for the breaking (bad) news if (5668 == $cat_det->cat_ID) […]

Why posts array is empty?

I try to get posts that either do not have a custom field set or if set have a value not like a given parameter. Here is my code: $args_included = array( ‘numberposts’ => 1, ‘post_type’ => ‘post’, ‘post_status’ => ‘published’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘requested_by’, ‘value’ => ‘%’ . […]

get_posts from a category id doesn't work

I use the following code to get portfolio type posts from category id, but it doesn’t work. $args = array( ‘numberposts’ => $items, ‘post_type’=>’portfolio’,’orderby’ => ‘date’,’order’=>’DESC’,’category’ => 5 ); $posts = get_posts($args); foreach($posts as $post){ setup_postdata($post); $return_html=’……’; } however,if I leave the category id empty, it’ fine and will show all categories posts. I’m sure […]

Query posts by Author and/or by Tag

I’m pretty sure I need to do some sort of custom query, but not sure about the best way to go with it. I have an author page. It needs to display that author’s posts. That’s fine, I can do that. I need to amend the query so that it displays the author’s posts as […]

How do I change the location of post-specific information?

On each post page is the following information displayed: Written by: nona Date Posted: April 24th, 2013 Category: drawing writing reading, General Comments: 3 Comments » Here is an example link. So the post info is situated in the top of the post. We would like to move it to the bottom of the post […]

wordpress remove views from action links in a custom post

I have created a custom post type, but I want to remove the View link from actions, in the listing of the custom post. I have tried this snippet add_filter( ‘post_row_actions’,array(&$this, ‘remove_row_actions’, 10, 1)); public function remove_row_actions($action){ unset($action[‘view’]); return $action; } But it throws call_user_func_array() expects parameter 1 to be a valid callback, array must […]

Adding a user's ID behind the <a> tag ref link address

Good day, everyone: I want to make wordpress to add the user’s id number behind the ref’s link string, so that, for example <div class=”toolsbutton”> <a href=”http://mysite.com/mysite/page-“>go this page</a> </div> above code will be turning in to a link if the user id is 113 who clicked it, the address will become: <a href=”http://mysite.com/mysite/page-113”>go this […]

Archive template combined with post slider and regular posts

I am trying to find the best and easiest way of modifying my archive.php template to contain slider on top which slides the 4 first posts and the rest (6) will be displayed beneath as a regular posts. it should work dynamically with one loop, meaning that if I am clicking on “Previous” or “next” […]

wpColorPicker – problem with implementation to post meta

I need your help as I am stuck and Google does not return anything, so I must be doing something obiusly wrong here, I just don’t know what. Basically, I need color input in one of my custom post types meta and I am trying to use a new WordPress 3.5 colorpicker for that. I […]