```
5. Click **Update File** to save changes
### Method B: Using Custom Plugin (Recommended)
1. Go to **Plugins > Add New**
2. Search for "Code Snippets" or install it
3. Activate the plugin
4. Go to **Snippets > Add New**
5. Paste the code above
6. Set "Run snippet everywhere"
7. Click **Save**
## Step 3: Create Custom Post Types
You need to create MCQ, Test, and Job post types. Add this to your functions.php:
```php
// Create Custom Post Types
function create_custom_post_types() {
// MCQs
register_post_type('mcq', array(
'labels' => array(
'name' => 'MCQs',
'singular_name' => 'MCQ'
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'custom-fields'),
'menu_icon' => 'dashicons-clipboard'
));
// Tests
register_post_type('test', array(
'labels' => array(
'name' => 'Tests',
'singular_name' => 'Test'
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'custom-fields'),
'menu_icon' => 'dashicons-clock'
));
// Jobs
register_post_type('job', array(
'labels' => array(
'name' => 'Jobs',
'singular_name' => 'Job'
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'custom-fields'),
'menu_icon' => 'dashicons-building'
));
}
add_action('init', 'create_custom_post_types');
L.C.M & H.C.F - ExamTonight - Largest MCQs and Forums Website - Page 5
Skip to content