Custom post types problem and "fatal error: require_once() " message
-
Hello,
I’ve registered some custom post types in my child theme. They are included in the directory: libs/posttypes.php and looks like this:
<?php add_action('init', 'mamepro_init_posttypes'); function mamepro_init_posttypes() { /* Register Announcements */ $announcements_args = array( 'labels' => array( 'name' => 'Og?oszenia', 'singular_name' => 'Ogloszenie', 'all_items' => 'Wszystkie og?oszenia', 'add_new' => 'Dodaj nowe og?oszenie', 'add_new_item' => 'Dodaj nowe og?oszenie', 'edit_item' => 'Edytuj og?oszenie', 'new_item' => 'Nowe og?oszenie', 'view_item' => 'Zobacz og?oszenie', 'search_items' => 'Szukaj w og?oszeniach', 'not_found' => 'Nie znaleziono ?adnych og?oszeń', 'not_found_in_trash' => 'Nie znaleziono ?adnych og?oszeń w koszu', 'parent_item_colon' => '' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'supports' => array( 'title','editor','author','thumbnail','excerpt','comments','custom-fields' ), 'has_archive' => true ); register_post_type('announcements', $announcements_args); } ?>
I added a function to funcions.php file located in my child theme directory to make it work:
require_once MAMEPRO_THEME_DIR.’libs/posttypes.php’;
But as a result I got an error message:
Warning: require_once(/home/marszand/domains/mamepro.org/public_html/wp-content/themes/path/libs/posttypes.php) [function.require-once]: failed to open stream: No such file or directory in /home/marszand/domains/mamepro.org/public_html/wp-content/themes/mamepro/functions.php on line 11
Fatal error: require_once() [function.require]: Failed opening required ‘/home/marszand/domains/mamepro.org/public_html/wp-content/themes/path/libs/posttypes.php’ (include_path=’.:/usr/local/php/p53/lib/php’) in /home/marszand/domains/mamepro.org/public_html/wp-content/themes/mamepro/functions.php on line 11
I wonder why wordpress can’t find posttypes.php and funcions.php files. If you can help me I’d be grateful!
Thanks in advance!
- The topic ‘Custom post types problem and "fatal error: require_once() " message’ is closed to new replies.