The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
27 views

How to edit the styles for the table of pages/post listed in the admin when you click on pages/posts?

It seems that some of the css on the table that shows the list of all the pages adversely reacts with one of my plugins, which adds a bunch of columns to the table. I'm pretty sure this is edit.php. ...
0
votes
1answer
30 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
27 views

How can I add a class to particular paragraphs in my post?

The effect I'm looking for in the end is to have the first line in some paragraphs bolded. These would be the first paragraph of each section in my post. This kind of effect is used on this ...
1
vote
3answers
25 views

Change Post Class function

I wish to change/remove parts of the automatic post class function that's built in to wordpress, lets say when i make a post, the html code generated looks like this: <div id="post-106" ...
0
votes
1answer
50 views

How to change “post_class()” for a custom post type?

I am trying to keep the classes the exact same on my normal (blog) posts, and a custom post type I have called "locations". When I post a "normal post" I get the following classes: class="post-# ...
0
votes
0answers
44 views

Call/link wordpress category with jquery/isotope classes

I am working on the portfolio section of my web, and these codes i have in filter.js script (in wp-includes/js folder) jQuery(document).ready(function(){ ...
0
votes
0answers
37 views

Use data-id for wordpress posts (individually)

I get the filters script implemented on my wordpress web by some developer, who's not good in wordpress functions but he did implement the filter script on web. That script is working on projects ...
0
votes
1answer
91 views

How to specify a class added to my gallery

I would like to add a class to my gallery short code, this is how I have added my class: [gallery class="small" columns="2" ids="350,349,302,305"]. Now the confusion comes in, I am not sure how to ...
0
votes
0answers
40 views

post_class() and the_ID spontaneously fail

I have a custom archive.php template in the theme I'm working on which seems to be misbehaving. Hopefully someone can give me some idea of what might be going wrong. My archive.php template loads one ...
1
vote
0answers
39 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
2answers
77 views

Where should I use post_class()?

I am trying to learn WP Theme development. And as I have understod it is important to use "post_class()" since plugins may need to use it. But what I not understand is where I should use it? Should ...
1
vote
1answer
196 views

Indirect modification of overloaded property WP_Post::$classes has no effect

I'm working on a child theme and while everything works the Walker_Nav_Menu and Walker classes are causing all the fuss. My parent theme overrides Walker_Nav_Menu as below: if ( ! class_exists( ...
0
votes
1answer
132 views

Custom query with post_class filter using current_post not working

I have a new WP_Query on my archive page. I also have a post_class filter conditionally adding a class of first so I can display them in rows of 3 reliably. This is the post_class filter function ...
1
vote
1answer
50 views

Is post_class(); going to slow Wordpress page speed

I just have a general question about the post_class(); function. As it gets category and tag classes relating to a post, is it database/server intensive to call this on a category page, or even a ...
0
votes
0answers
33 views

How can i add radio fields to my custom post ? Nothing works

I have 2 files in my plugin for this, one makes the custom post type and its meta box and the fields for the meta box. The 2nd file prints out the meta box, its basically the layout. I am able to ...
0
votes
1answer
254 views

Wordpress call post-ID in jquery

I explain the situation I'm having here: On my home page, I have a list of post being display. I've code to have like a modal box to share this post. Basically, on each post you have a button share. ...
1
vote
1answer
31 views

WordPress post arrangement using post_class

I want to create post layout in the following way: +--------------------+ | 1 Full Width Post | +----------+---------+ | 2 | 3 | +--------------------+ | 4 Full Width Post | ...
0
votes
1answer
27 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
2answers
182 views

How to style posts selecting a CSS post_class (added through custom_fields?)?

Here is what I tried and couldn't reach it. Maybe I need a whole different approach? 1) I created a custom field in a post, called post-class and inserted the value cita-flow800000 (weird class name ...
0
votes
1answer
218 views

Every second post different class in blog view

To assign different classes to every 2nd post in blog view in WordPress adding this code into function.php was suggested as solution. Most people claim it is helpful, but to me it just adds odd at the ...
0
votes
1answer
67 views

What Generated Classes and IDs That Is Always Used On All Themes?

Just wondering if there is a way to get a complete list of wordpress generated css classes and ids that is always automatically assigned to any themes. I've read here, but it seem not list them ...
0
votes
1answer
118 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
260 views

post_type_exists keeps returning false

I have a little helper class for registering new custom post types. However, it seems it is registering the custom post type on each page load. I put in a small check for this: if( ! ...
0
votes
1answer
101 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
2answers
2k views

Adding class to featured image

I have specified a loop to show featured images for my custom post type and wish to add a img-responsive class from bootstrap to my featured image. How can I do this? Thanks! Code: <div ...
0
votes
1answer
77 views

Add a class to post if it has been recently updated

I'm trying to add 'updated recently' after the post title. I've discovered some code which works but because of plugins and some theme coding it affects numerous instances of the_title that it ...
0
votes
1answer
205 views

Microformats in a single post - layout conflict

WordPress uses microformats, for example, when we use the function post_class() in the DIV containing the article. It automatically includes the class called hentry, which is used in microformats. ...
1
vote
2answers
787 views

Wordpress: How to use post_class() in an echo

I am working on a foreach loop in Wordpress and want to add 'post_class()' to a div within it. Currently the code looks like this: if ( is_array( $posts ) && !empty( $posts ) ) { echo ...
0
votes
1answer
68 views

wordpress add field to post_class

I need to add a custom field to my article post but not sure how to add an additional class to it. Currently the classes get pulled through like this <?php post_class($classes); ?>. However I ...
0
votes
2answers
201 views

post_class not working with css

through the codex I read about how to use the post_class() function to create a css hook for styling the content. Here is the code I have, PHP: <li class="<?php post_class();?>"> ...
0
votes
1answer
7k views

How to add class or id to shortcode HTML elements?

I have a row elements and 3 columns inside : [row] [one_third]1[/one_third] [one_third]2[/one_third] [one_third]3[/one_third] [/row] How can I add a custom class or id to [row] element ? I need to ...
0
votes
1answer
55 views

Wordpress Tags in class

I have added tags to my Custom Post Type. Now I want to use them to create a isotope portfolio, I can load all tags with this code: <?php $args = array( 'post_type' => 'portfolio', ...
0
votes
1answer
120 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 ...
1
vote
1answer
563 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
1answer
545 views

Get categories list with category name in custom WP_List_Table class

Im building a plugin and i made custom wp_list_table class to suit my needs and display items with native wordpress look. The problem is that i can't get to list categories with categories names. I ...
4
votes
1answer
436 views

Category as Class for Custom Post Type

I've only just realised that custom post types don't appear to output the category as a class in the loop, via post_class and I wonder if anyone can suggest a work around. Is this something that ...
0
votes
0answers
132 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; } ...
0
votes
1answer
145 views

different post-class when template is loaded via ajax

my event-item.php <?php /** * The event template */ ?> <li> <article id="event-<?php the_ID(); ?>" <?php echo event_canceled($post) ? post_class('wrapper canceled') : ...
0
votes
0answers
22 views

Styling every second Post differently? [duplicate]

I wanted to style every second post inside of a query post and I found a solution which nearly works. the thing is: it outputs just two posts (older ones will be igrnored) but i want to output ALL ...
0
votes
1answer
75 views

Apply Post Class to Custom Post Type

I am trying to add specific CSS post classes to the services custom post type. However, when I apply this function to the post class filter, it applies the function to all post types. My goal is to ...
1
vote
3answers
6k views

current-menu-item class for custom post type parent

Im having a problem with my menu and custom post type. I have a custom post type of "services". I have created new page for it called Services. On that page Im displaying a list of all the post from ...
0
votes
1answer
2k views

How to add class to anchor using wp_nav_menu

Sorry if my post duplicate but i can't find best solution for my problem. I'm newbie on develop WP theme. Now i'd like to add class to current li and last li, but i don't know how to do? Hope someone ...
2
votes
2answers
3k views

Add class to the items in wp_list_pages

I just want to add a class for the active page in the wp_list_pages().Is it possible? If so can I provide a particular class for a active page. Here is my code for listing the parent page and its ...
0
votes
1answer
76 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
1answer
66 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 ...
1
vote
1answer
334 views

Output terms to post_class()

I am trying to output all terms attached to a specific post (including custom taxonomy terms) as CSS classes applied to a DIV Something like that : <div <?php post_class('class-name'); ...
0
votes
2answers
48 views

Post classes in the loop are being changed in certain themes

Certain themes don't use the default post class structure in the loop ie <div class="post-100 post type-post status-publish format-standard hentry category-uncategorized"> Spacing.ca, for ...
0
votes
3answers
265 views

Using post_class to style posts indivdually

I have a homepage on which I want to display the latest post different from the other posts. I haven't used post_class and I am not sure how to. Would I be able to achieve what I want using ...
0
votes
2answers
929 views

How do I add a custom body class for a specific page ID?

I have added this code to my child theme's functions.php file and use the new class but it styles the entire site, not the page I added to the code. What am I doing wrong? ...
1
vote
1answer
253 views

Add a class to post title if a link ends with a certain extension

I am using a Page Links To plugin that allows me to link the post title to an external web page, rather than to the content of the post. And I link some of the post titles to external pages, and ...