Articles of posts

wordpress content .php file in an iframe's src in a wordpress post

I would like to insert an iframe with WordPress content inside a post. I explain myself. I have two things: a post and a presentation. In the the_content() WordPress filter, I add my iframe to the $content. This iframe has a src pointing to a custom .php file, and inside this .php I want to […]

why the same code got different results when using query_posts in functions.php and index.php

I am using WordPress 3.5, and my blog sites have many registered users. After they log in, I want them to see just their own posts, not others. So I added this to my functions.php, but I get a blank page. function only_login_user_post_on_homepage() { $current_user = wp_get_current_user(); query_posts(‘author=’, $current_user -> ID); } add_action( ‘pre_get_posts’, ‘only_login_user_post_on_homepage’ […]

How to get all post_parents of a post?

Unfortunately, $post->post_parent is a single variable and not an array. I want to get all post_parents of a post (especially of an attachment, which is often linked to multiple posts!).

Can't get full post title if there a spaces in title

I want to make a custom query that checks the post title and puts in a different URL like this: <a href=bing.com/search?q=<?php echo single_post_title(); ?>>Blablabla</a> But it does not work for me if I have a post with a space in it, like Hello World. Then it only shows me Hello in the link. How […]

Print out last 3 blogposts

From problem to problem, disco to disco 😛 My template requires that i print out headlines of 3 last blogposts in the header of my template. Its single page layout so those blogposts will link to posts that will be on page anyway – just somewhere down the line… Since im complete wordpress newbie – […]

Importing posts only – consequences?

One of my client holds a slow Internet connection. So he wants to do all his web updates locally (by any means – he doesn’t understand codes) and then he wants to update the website by any easy and quick means. Now I’s thinking to make him a localhost setup in his PC, and setting […]

Append 'Continue Reading' link if post length is more than 3 lines of text?

I’m pretty new to coding for WordPress, bear with me. I have a section on my home page, that lists the 2 most recent blog posts. If the text goes past three lines, my design gets messed up. So I was wondering if there was a native function that exists for me to append ‘Continue […]

relating business and products with custom taxonomy?

This isn’t a code question so much as a how would you do that kind of question. What I can’t figure out is how to relate businesses to the the products that they sell. If I’ve got a custom post type and related taxonomy for a product (post type of product and taxonomies for price, […]

Add Post As a menu Item

When I write a post, I want to put it under one of the menu categories so it shows up. How can I do that? Please Help

Automatically create a default set of posts for each new registered user

Is there a plugin, or a way to automatically create a set of default posts for a new user when they register? I suspect that the answer might be to hook into the existing wordpress events – can anybody suggest a way to get started?