Articles of posts

Custom post type and body_class: Remove “blog” class

I am using body_class(); to style different sections of a wordpress site by their body class. Page styles descend from .page-template, blog styles descend from .single-post and/or .blog etc. I have created a custom post type “Products” for the products section of the site and want to style this section specifically using it’s body class, […]

WordPress' visual editor messing up my (nested) lists (and other things as well)

I always have trouble trying to create some nested lists in WordPress using the default editor in visual mode, since I want to avoid the HTML extra work. Even though I write the HTML myself in the HTML editor mode, the page sometimes will not listen to my HTML and change things as it wants. […]

Remove image from post also removes photo from media library

Is there a simple way that will remove a image from the post editor and the media library?

Multi-site: removing /blog from posts

I’m deploying a multi-site network, using subfolders. I’ve found on the main site the permalinks for news posts can only be placed like so: /blog/%year%/%monthnum%/%postname%/ I understand that this prefix is needed to lessen the risk of conflict between the main site and sub-sites. Unfortunately this is a serious website, where the word ‘blog’ isn’t […]

Embed WordPress Admin in an iframe

I am trying to embed the admin “new post” WordPress page into an iframe: <iframe height=”500px” frameborder=”0″ width=”740px” src=”my_wordpress_domain/wp-admin/post-new.php”/> For some reason the iframe loads a blank page. The link itself works in a separate tab and so does the wordpress home page. Is this a security issue, if so, how can I circumvent it?

How to create a load more post entries like Twitter?

Hey guys, last days i have been trying to figure out how to do that. As read on but inside wordpress. And i have finally come with a solution, may not be the best one but i hope you guys can improve my code and post it here just like i`m doing. Feel free […]

Set Expiration Date of a Post from the Frontend with wp_insert_post

i try to build a form that users posts from frontend, everything works fine but i need to know if it’s possible, if i play with the ‘post_date’ => date(‘Y-m-d H:i:s’)? if i add a hidden field that generates the expiration day (+30 days from the post day) and then add it to the post […]

Delete Post Link to delete post, its meta and attachments

I used // Delete Post Link function wp_delete_post_link($link = ‘Delete This’, $before = ”, $after = ”, $title=”Move this item to the Trash”, $cssClass=””) { global $post; if ( $post->post_type == ‘page’ ) { if ( !current_user_can( ‘edit_page’ ) ) return; } else { if ( !current_user_can( ‘edit_post’ ) ) return; } $delLink = wp_nonce_url( […]

Using the “Latest posts” feature on a different site

I want to display the “latest x posts“, like you see per default on the index-page, but on a completely different site. E.g. /blog/ Installing WP into the directory /blog/ is not an option, as the other pages will be managed with WP. Currently I’m using the NuRelm Get Posts plugin to get the content […]

How to generate numbers indistinguishable for the IDs of the posts

For a few days I’ve been after a filter or a function that creates more random ID’s for posts like: 1920363522091 or Hpw_027991m-q Instead of the wordpress pattern that is: 1, 2, 3, 4 … It can be in sequence too, but starting with a very high number that with time becomes indistinguishable. I researched […]