Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

gombroo on "Custom post types and "fatal error: require_once() " message"

$
0
0

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!


Viewing all articles
Browse latest Browse all 8245

Trending Articles