Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [post-class]

The tag has no usage guidance.

1
vote
1answer
75 views

How to assign classes to all elements?

Is it possible to assign classes to elements of certain type? For example, all paragraphs in the post body or comment body should have class="paragraph", all unordered lists in post body should have ...
0
votes
1answer
111 views

get_post_class not working properly

I have a plugin on my WordPress site that lists the most visited pages. I recently realized that it was displaying certain pages that I don't want to display. I also want to be able to disable pages ...
0
votes
1answer
40 views

Highlight a Post on archive page if it has a new comment?

I have been searching for a solution to highlight a post if it has a new comment but there is no plugin/forum answer about this. Basically I have a custom post type listings on a page. I want to add ...
0
votes
1answer
51 views

Method 'post_title' not found in class.

I'm running some code through phpStorm and am getting an error: Method 'post_title' not found in class. at this line: echo $post->post_title(); Is that phpStorm getting things wrong or am I ...
0
votes
1answer
564 views

Post Class for Custom Taxonomy Error

I'm getting two errors with the following code. I'm essentially trying to go through all the custom taxonomies and add them to the post class. Notice: Array to string conversion in /...
0
votes
1answer
110 views

Different styles for categories - need to edit a plugin

I'm using a plugin to add recent posts to home page and I am using different styles for the categories. I have the different styles working on the blog page but not on the posts output from the ...
0
votes
1answer
131 views

Help with output of post classes using apply_filters

I’m new to scripting, this is a plugin I'd like to modify to output post classes. When I try using: apply_filters( 'post_class', $page->post_class ) it only outputs array=" ". Do I need an ...
0
votes
1answer
82 views

How do I create a sticky sidebar?

How do I give the three posts here different div classes? I'm working with twitter bootstrap and I'm trying to give the first post and the last one <?php query_posts('category_name=Menucard'); ?&...
1
vote
0answers
96 views

How to load post_class() locally

I'm using post_class() function to retrieve WordPress provided classes for a post. I've successfully implemented an AJAX powered "Favorite Post" functionality to each and every post, and I'm changing ...
0
votes
0answers
295 views

Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?

I have a couple of custom post types (course and assignment) for an custom LMS plugin that I'm building. The course CPT represents content that is produced internally by the company. The assignment ...
0
votes
0answers
171 views

How to remove a class from a post_image div?

So for a post i know how to remove a class by using function remove_class( $classes ) { $classes = array_diff($classes, array('hentry')); return $classes; } add_filter('...