What is the error message being generated?
Also, to avoid conflicts, all custom Theme functions, classes, options, constants, etc. should be prefixed uniquely, e.g. using theme-slug
.
It is highly likely that a generic function name like my_init_method
is used by another Plugin or Theme. Try renaming it to mytheme-slug_init_method
.
EDIT:
To implement, rename your function call from:
function my_init_method() {}
to:
function mytheme-slug_init_method() {}
Then, change your hook call from:
add_action( 'init', 'my_init_method' );
to:
add_action( 'init', 'mytheme_init_method' );
Related Posts:
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post status not working
- Search that will look in custom field, post title and post content
- Load custom posts with same tag as page
- Date archives for custom post type
- If featured image doesn’t exist, show post content
- How can I add dropdown widget/box to admin post page?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- How do I redirect all 404 errors of a specific post type to another URL?
- Filter posts with ajax form and checkboxes
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- How to save the checked boxes?
- How to get only one category of custom post type?
- Error after deleting Custom Post Type with a function (no trash used)
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- Using WPAlchemy metabox values in another metabox
- List terms from Custom Taxonomy
- WP_Query search posts by custom post type and custom taxonomy
- Display custom field of specific post where post title matches variable
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- How to count custom post types with conditional operators
- GravityForm: Populate Dropdown with custom post type [closed]
- How to output wordpress custom tags separated by comma?
- Show Different Header on a Specific Post ID
- Admin notice not displaying
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- Custom query to filter posts that have current post as a taxonomy [closed]
- get_posts of Custom Post Type AND Custom Taxonomy
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Loop throws 500 error when used in widget
- Received nothing after executing AJAX post function
- Replace text in post from cvs
- Get parent categories of custom post type
- I need to add endpoint for wordpress categories
- Can one create multiple Custom Post Types with a for loop?
- Categorize custom post type
- How to add custom field to view-edit post type page
- Hide a widget inside a div on specific type of post
- How to import a custom MySQL DB table into a WordPress custom post type
- Static apple-app-site-association file with wordpress
- Function causing the loop display posting more (empty)
- Foreach inside shortcode not working as planned
- Displaying custom field according to date
- Add additional field to custom post_type
- Set featured image to archive.php
- Get term name without a foreach loop
- custom post for slider
- Using wp_query to modify the loop in index.php for a CPT
- Get custom post type categories to show up in menus
- How exclude or skip post type with get_next_post_link
- widget_posts_args not using the number of posts in widget
- Create short URL with auto 301 redirect
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Undefined $post in wp_query
- Is it possible to use array_walk() to append terms to an array of posts?
- get_post_types() can’t get some of my post type
- Creating shortcode id for custom post types
- List latest post out of 2 custom post types
- Different column width in 2 rows with bootstrap and custom post types-different classes needed
- Menu’s breaking, now showing all page links on site
- Fetch data from two custom post types and create multidimensional array for output to html table
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Page that lists publications by classifying them by taxonomy
- How to get the custom post data using post id in WordPress?
- See if the email exists or not
- count & sum the value of custom field of the author post in dynamic posts
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- How to add specific terms in a custom post type?
- Assigning categories to custom post types via a front-end form; only works for native post type
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Custom sorting in post columns by ACF Pro Select Field
- programmatically generated custom post type is created more than once
- Visualize info in just custom post_type in theme
- cpt not display inside nav menu
- wp_post_delete is deleting all offices
- Custom Post Type has wrong label and is not found when called by a loop
- Create posts inside CPT post
- Taxonomies are not showing in the category dropdown
- Combine multiple separate lists into one
- current-post-parent for custom post type
- Having issue on Loading Meta Data From CSV to CPT
- Rewrite URL of Specific Post of Custom Type
- Custom Taxonomy – fields
- CPT post doesnt shows tags and category on backend admin page
- The most recent post of custom taxonomy
- Meta Box not being added in plugin
- Get month and day from a Date Picker custom field
- Return all wordpress custom posts in specific multidimensional array
- Add number in increment of one to DIV ID
- Select Menu for Custom post Type does not save
- Custom Portfolio String
- is_singular won’t call my functions?
- What is the most efficient way to manage changes my product comparison tables?
- Dynamically change Custom Post Type Template OR Change Permalink?
- Inserting two categories
- Comments are not working on Custom Post Type
- Add Category names to post lists of custom post type