You need to make the function pluggable, that means, to support child themes, the functions in parent theme should use:
if ( !function_exists( 'function_name' )) {
function function_name() {
//Stuffs
}
}
You should have seen a PHP Error message if you have debugging enabled.
EDIT: The below code snippet if to answer your other question in comment.
function modify_read_more_link() {
global $post;
return '<a class="more-link" href="' . get_permalink( $post->ID ) . '">Your Read More Link Text</a>';
}
add_filter( 'the_content_more_link', 'modify_read_more_link' );
Related Posts:
- Multiple is_page() in page.php
- class=”parent” for wp_list_pages?
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Listing all sub-pages?
- syntax issue on php 7.4
- How do I publish only one page to production after making changes on staging?
- Can’t load WP function into external function
- Can’t get page content in WordPress
- Way to querry data (tags) from a wordpress database?
- Populate editor with some content of a page with a page template
- Create Page To Count Comments For Each Post In WordPress Site
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- How to use theme function in post/page?
- Need php code’s output to display underneath a Divi Module
- How to Display a List of Child Pages For a Parent Page in WordPress
- A function to get the content of a page
- Getting page / post URL on publish and / or update
- How to return a Boolean for a page that is a subpage thru its name?
- How to call a function only once (global variable scope)
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to correct schedule my event weekly with wp_schedule_event()
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- Execute a shortcode when clicking on a image
- How can update custom meta for all posts
- Is $hook a global variable in WordPress
- Passing the page ID to a login php script
- wrong php date()?
- Include a php file from functions.php only to homepage
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How do I display a user’s previous orders as a select box option on a product?
- Handling Body class based on Template
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- get author_name from queried post
- Pass php dynamic variable to shortcode
- How can I add an area/option for a custom page description?
- Modify custom field input data before creating a new post
- Query Pages and post excerpts dynamically
- Is there a way to conditionally check whether a WordPress post title is empty?
- How do I find PHP file that contains content of my page?
- WordPress page content outside WordPress
- Get my site session in wordpress?
- is_user_logged_in() not working in AJAX validation call
- Register a menu – Error Header
- Shortcode to find and replace URL
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Set site title & tagline with wp.config or function.php
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- iframe not showing in content on blog page
- Get user custom field value on function.php
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- entire JS folder not loading in a WP theme
- Get the name of menu item with wp_nav_menu
- Else/If Statement to Display Photo Descriptions
- Query for user roles
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- WordPress Search
- Displaying Event within two given time frames
- How to prevent a function from running based on host (ie web vs local)?
- How to call custom function outside from the admin page?
- Is there a way to create a “copy post” link?
- Use of antispambot with $curauth->email
- Reject all malicious URL requests functions.php
- Edit and delete permissions pages and posts
- Notice: Undefined variable
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Access to “My Site” is missing from the admin bar
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- How to call WordPress PHP file using external js file
- Need help with PHP functions
- Using get_theme_mod with checkbox to display content
- WordPress styling recent post
- Styling admin page rows in order of importance (checkboxes)
- Insert wordpress tags below posts via functions.php
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- How to handle parent and child pages?
- Adding multiple conditional tags in a function?
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Automatically change insurance quantity based on cart total [closed]
- /page/2/ redirect to 404
- How to pass value to add_filter wpcf7_form_tag from another function?
- hiddenQuestions.find is not a function