do_action( 'after_setup_theme' );
doesn’t pass any parameter. You are cutting something of the length 0 after theme setup. Why?
Plus, your registration with add_action
doesn’t tell WordPress that you want two parameters. The default is one parameter.
You don’t need this call at all. If you define the function in your functions.php
it will be available in the loop.
Learn the Plugin API, it isn’t so hard. 🙂
Always prefix you functions. Otherwise your users may get fatal errors when someone else has written a function with the same name.
If your function does what I think it does, you may have a look at my function utf8_truncate()
. No regex needed.
Related Posts:
- my blog crashes ie7?
- Are immediately-called actions not usable in themes?
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Loading template files from a subfolder in my theme?
- The style.css stylesheet doesn’t contain a valid theme header
- Remove action within a class in a parent theme from the child theme
- Problem : deletion failed, the theme requested does not exist
- Using a _GET gives me a debug error (over my head)
- Delete database tables on theme uninstall?
- How can I show more than 15 themes at a time in the admin menu?
- How to trigger function on theme delete?
- PHP Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 230 [closed]
- wp theme.. Could not create directory
- Console error, even if everything is working?
- Make it possible to pick a color theme for specific pages
- OptimizePress Theme Overriding add_filter page_template
- Execute filter in theme as last
- Fatal error with a theme
- Getting 503 on various files
- Redux callback action
- How to display message (with switch_theme hook) after deactivating My theme?
- What hook is the currently active theme’s functions.php file loaded on? [duplicate]
- Finding and disabling ‘rogue’ stylesheet from header: Source Sans Pro
- Remove problem PHP code entered into footer via Theme
- Twenty Seventeen search error
- Is it good practice moving the main stylesheets after the plugin styles?
- WordPress suddenly creating theme errors
- Debugging in WordPress at Theme installation [duplicate]
- Posts as filtered list – expandable
- .PO file is found but I don’t see translations: how to debug the problem?
- How can I remove all traces of a theme?
- Undefined variable error in theme option after updating theme [closed]
- Using filter in the widget causes fatal error
- Error when installing theme – “failed to open stream: No such file or directory in…”
- Functions.php error – when trying to change the theme
- My blog suddenly can’t find my stylesheet?
- How to fix Scrape key check failed on WordPress VPS?
- Why does an ad page open when I browse my websites’s wp-admin page?
- Don’t prepend WordPress base url to image paths
- Problem: Fatal error worldpress theme
- Custom CSS is overwritten by WordPress?
- The function is deprecated; use mysql_real_escape_string() instead
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Firebug and Chrome rendering two body tags
- Costum Theme template directoy url problem
- How to remove the option data of a theme when that theme is removed?
- Diagnosing a connection reset problem
- Where can I find the “add_action()” inside a theme?
- “Parse error: syntax error, unexpected” and the WordPress Theme Editor no longer working!
- What does exactly GPL license mean for my WordPress theme?
- Categorising themes by folders in backend
- Display a different theme for not logged-in users
- Custom Upload Panel in Menu Bar
- Please explain me what the do_action does
- WordPress themes under GPL license
- How to remove header image on subpages in Twenty Eleven (default theme)?
- Can I update themes without enabling maintenance mode?
- Disable Theme API / Front end (for API only environment)
- Showing post thumbnail (attachment) on the archive.php category listing
- When to use add_action when registering/enqueuing scripts
- Add more widget areas to a theme
- Posts and Pages not showing on admin, but showing in theme
- How to Debug WordPress
- How can I add class to every quote element?
- wp_get_theme() works fine, but wp_get_themes() returns empty array
- Read More Button Not Responding To Click
- How to use command lines an activate theme in wp – cli also setup Vagrant/Sage Theme?
- How to change the format of posts on the hompage?
- External Script Using WP – Hooks / Actions Not Working?
- GPL 2 Theme using a framework for commercial Theme?
- i would like to have 3 default columns editable in guttenberg
- WordPress 5.1 upgrade has lost the parent theme JavaScript
- Admin: how to make a custom list filter button send GET queryvars
- Create page options for theme?
- Permissions error
- Never actually adding the action? Or do I have to call the action?
- Where is the best place to catch useragent?
- How to hook into action/filter call
- How can I change the prev / next buttons text to Dutch?
- Woocommerce single product image blurred and small. Actual image is big
- Get data from Theme Options and use them into meta options field in custom post type
- Are the Theme frame works or Theme builders slow downs the performance? [closed]
- Make the “Add New Post” one column for all users
- First click to blog title does not open the blog article
- Trying to revive an old wordpress site, but newer versions of wordpress install a different db structure
- Theme translation not working
- Unable to activate themes on localhost
- How to change allowed attachment files extensions
- Transfer WordPress site to another domain
- Why Underscores Theme Comment Form Reversed?
- Passing a parameter to filter and action functions
- What problems could happen if I replaced add_filter and add_action with the function calling
- Adding to an array & passing it through do_action/apply_filters
- How can i limit wordpress post title characters in sidebar?
- Theme making direct ajax calls to theme folder
- How to add sidebar to homepage programmatically?
- How to remove header “ish” label [closed]
- Can i Remove copyright text wordpress.org theme
- Help with Divi logo not appearing for 10s
- How to clone a theme template from within WordPress? [closed]