I'm trying to create a appointment plugin, and so far it is working that I can create appointments and see the detail view from the appointment.

The problem is, on a page called "appointments" where I wan't to list all appointments, nothing is displayed. I also would like to know, how I can modify the way all appointments are styled. I would like to have it placed in 4 columns.

I know the markup for this columns, but I don't know where I have to modify the plugin.

1 Answer
1

Generally, replacing content, especially with output buffering, is, at least in my mind, not very good practice. So you might consider making use of wordpress' templating system - see Codex: Templates for a start.

The former would also lead to, where your markup has to go. Or if you not using templates you have to write it into above files. Actually you are making use of templates already, with:

get_template_part( 'content', get_post_format() );

Which is looking for content-the-post-format.php, but shouldn't this be:

get_template_part( 'content', get_post_type() );

So you can create a template file content-the-post-type.php for that.

Additionally you are using $posts as variable name which is a global variable name used by wp, so this will lead to problems. Change the variable to a none-used/reserved name, generally, try using distinct and unique names to avoid conflicts. There is not need for the global $post; you are doing, you should also add wp_reset_postdata() to your code. Best you take another read of - at least - Codex: get_posts() to learn more yourself about how to do this.

These are just some pointers of course, but they should get you going into the right direction.