Calling a plugin from a page template in TwentyEleven

Call the method in the class in your template file WPRandomPosts::GetWPRandomPosts($cat_ID, $col, $UseExcerpt, $beforetitle, $aftertitle, $beforecite, $aftercite); Give the params in the function for ypur custom output. $col is Number of entries $UseExcerpt is for Display a quote $beforetitle is the Tag before heading out on $aftertitle is the Tag after the header record $beforecite … Read more

PHP displaying wrong custom taxonomy images

I think (at least part of) the problem is that you’ve got a nested loop where you don’t really need one. The output of get_terms() is an array of objects. So $categories should be an array of objects. You loop through this array of objects here: foreach ( $categories as $category ) { $id = … Read more

Exclude function from running on a certain page

This works for a page on my site with ID 675: function tst($content) { if (is_page(675)) print(‘howdy’); } add_action(‘wp_footer’,’tst’); I would just interrupt the function right at the top. function keyboard_shortcut_navigation(){ global $paged, $wp_query; if (is_page(2020)) return; // for a post with ID 2020 if (is_page(‘2020’)) return; // for a post with slug or title … Read more

page 1 is not paged

do you mean you want a conditional for page 1 of all home queries which have more than one page as result? try to use $wp_query->max_num_pages; example: if (is_home() && $wp_query->max_num_pages > 1 && !is_paged()) echo ‘/page/1’; else echo “https://wordpress.stackexchange.com/”;

How can I fix this code [duplicate]

prepare has always required two arguments, it just didn’t throw an error when used incorrectly until 3.5. Basically, the use of prepare in this case is not doing anything. Since you’re not passing potentially unsafe data to the query, you can remove it entirely to get rid of the error and just pass your query … Read more