I can't see the classes into the Schedule
-
Hi,
I created some classes, with subject, level, teacher, day, starting and ending time… The schedule is generated ok, in respect with my days and hours, but there is no class shown.
Actually, when I generate a class post, after publishibg it, if I want to see the class post, it goes to a 404 page…
Any clue?
Thx
Andrei
-
Hi,
First I recommend updating Easy Classes to 1.1 if you haven’t already done it. It’s better we talk about the same version ??
I have already encountered the 404 page problem with classes. It’s a common problem with custom post types, you need to visit the permalinks admin panel, as it updates the htaccess file.
Try that first.If it still doesn’t work but the preview works, it could mean the publish function of WordPress for custom post types is broken.
Try creating a “teacher” post, and see if it publishes correctly on the site. Let me know if teacher posts are working.Are the classes displaying above the schedule, as a list ? If that’s the case, it means they are correctly saved in your database, and the problem lies somewhere in the schedule function. In that case it will be hard for me to know why your database doesn’t work with the function, as I only use WordPress functions to connect to the database, but I’ll try.
With the infos you gave me, my guess is a problem with the “publish” status of the posts, because beside from this class posts problem, everthing seems to work fine, and the function getting the class posts is quite simple, requiring only two things : an “easyclass” post type & a “publish” status. If for any reason (another plugin causing this ? WP bug ?) the class posts aren’t really published, it would explain why they don’t appear in the schedule.
The difficulty with a bug like this is to know if it comes from your version of WordPress, or another plugin installed… Tell me the version of WP you have, it will help me find a solution.
Best regards,
Melina.Hey, thx for your reply.
I really want to use your plugin, I administrate several websites that need it.1. The plugin version is 1.1.
2. What I see now is there is no 404 anymore, the post is ok. But the schedule is still empty. I don’t know what to check more. Example of a class post: https://www.casadetango.ro/easyclass/practica-pentru-nivel-1/.
3. I created a “Teachers” post, but I don’t have any characteristics to choose (hours, day, levels, room etc.), except the ‘teacher’ that I’ve already set in the Classes menu. The post doesn’t show in the schedule…
4. There is no list of classes above the schedule.
5. I don’t know what to say about a possible publish problem, all my posts are fine now.
6. WP version: 3.6.1, the latest.If you think you can help me, I can give you a username and a password for admin, to take a look. For this, I need an email address or a private message solution ??
Thx again,
AndreiI’m glad that the plugin is useful to you !
I’ll do my best to solve this schedule problem.2. One problem solved ! ??
3. Teachers post are useful for creating presentations pages for teachers, the classes are automatically listed (example here, don’t mind the design, it isn’t great : https://polytech-antibes.fr/teachers/mme-andro/ )
I suggested to create one in order to see if there was a problem with publishing custom post types, but now that your class posts are published, it seems the problem is elsewhere.
4. 5. 6. Okay so your website is totally fine, and the problem may be in the function getting the classes.This is the function by the way :
function eac_get_classes() { global $wpdb; $classes = $wpdb->get_results( "SELECT ID, post_title FROM wp_posts WHERE post_type = 'easyclass' AND post_status = 'publish'" ); return $classes; }
The schedule is getting the hours and days, so it isn’t a database connection problem…
I think the problem may come from $wpdb->get_results, but it’s a WordPress standard function, and it’s hard to known what is going wrong with it. We need to know what the query $wpdb->get_results returns.
You can handle this yourself if you wish to.
Click on “Editor” in the submenu of “Plugins”. At the top right of the page select Easy Classes in the list, and click ok (or “select” I don’t how the ok button is called, I use the french version).
In the file list on the right, click on easy-classes/schedule.phpYou’ll see at the top of the page the function I was talking about :
## Get posts by custom post type 'easyclass' ## function eac_get_classes() { global $wpdb; $classes = $wpdb->get_results( "SELECT ID, post_title FROM wp_posts WHERE post_type = 'easyclass' AND post_status = 'publish'" ); return $classes; }
Add it that line :
var_dump($classes);
Like here, just before “return $classes” :
## Get posts by custom post type 'easyclass' ## function eac_get_classes() { global $wpdb; $classes = $wpdb->get_results( "SELECT ID, post_title FROM wp_posts WHERE post_type = 'easyclass' AND post_status = 'publish'" ); var_dump($classes); return $classes; }
Click on update the file and after it’s updated go refresh the schedule admin panel.
It will print informations (massively if the classes are found and you have a lot on your website /or/ short, empty info if the classes aren’t found).Though, I can check what’s wrong myself if you seem to trust me enough for this. I’m honoured, by the way, just be careful to not give admin access like that to anybody, after all we’re on the internet ??
You can email at [email protected]
Best regards,
Melina.The problem was caused because the website is multilingual. I easily managed to adapt the query for properly getting the classes.
Though, the schedule colours aren’t saved properly for the moment, it’s harder to modify the queries here. I’m working on it.
There will be an update today that will at least resolve the getting of the classes for multilingual sites.
Melina.
Melina, you’re great! I gave you 1 issue and you solved 3…
Nice support – I wish all the developers to be like you ??Keep up the good work!
Is there any way to show all all days that i sellected in schedule page? i dont want to see just last one…
Answer moved to proper, separate topic ??
- The topic ‘I can't see the classes into the Schedule’ is closed to new replies.