0
votes
1answer
20 views

Overide enqueue in non plugable function via child theme

I am trying to override a non-plugable function using the information on this page but it seems to have no effect. Can anyone see what's wrong. My code is remove_action('wp_print_styles', ...
0
votes
0answers
61 views

Suppress the_content filter in a nested loop

I have some layout changes that are being applied to the_content. I need to do one of two things, but neither is working as expected... either: Pass data to the filter so that it knows if it is a ...
0
votes
1answer
183 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
2
votes
0answers
156 views

How to write .htaccess dynamically? [closed]

I am trying to set permalink structure on theme activation. The following function included in function.php of theme. // Executes function on theme activation function myactivationfunction() { ...
0
votes
0answers
112 views

add_action not working in header?

i need to enable the session variables to my theme , so i have the following code in my theme functions.php function session_manager() { if (!session_id()) { session_start(); // Get ...
0
votes
1answer
67 views

Is there an action for save_menu and/or update_menu?

I want to "save" my menus into transients. I want to update those when there's been any changes to the menus via the admin custom menus. I've looked for an action but can't see to find anything. ...
0
votes
1answer
127 views

Replace function in a child theme

Is there a way to replace a function by another function in a child theme? In other words, in a theme there is a function named "theme_function" and this function is called by several files inside the ...
3
votes
5answers
415 views

How do I make a theme “plugin-ready”?

How do I revise a theme so that I can publish my event hooks and anyone can build a plugin to add new functionality easily to my theme?
2
votes
1answer
990 views

How to use filter hook 'post_updated_messages' in coherence with action hook 'save_post'

I am trying to send out e-mail, SMS and IM notifications to group members of this WordPress website, whenever a WordPress page in their user group has been published/updated. I figured using the ...
4
votes
2answers
9k views

When to use add_action('init') vs add_action('wp_enqueue_scripts')

In my theme's functions.php, I'm calling an add_action in order to gain a measure of control on where jquery is loaded (in the footer along with my theme's other scripts). The problem I'm having is ...
9
votes
4answers
2k views

after_setup_theme always runs

I am setting up a child theme for some of my faculty members, and as a part of the theme, I would like a handful of plugins to be activated at the time that the theme is activated. So, naturally, I ...
1
vote
1answer
866 views

Add something to beginning of content with add_action('the_content')?

I'm using add_action('the_content', 'myFunction', 10) to append data to the end of the content. How can I place content at the beginning of the content?
2
votes
2answers
128 views

What's the best action to use when you want to do something only once per theme setup?

I'm writing a theme which has it's own set of database tables. I'm wondering what is the best action for me to use when I want my install function to be invoked only once when the theme is activated ...
0
votes
1answer
246 views

save_post action doesn't passing post id to my function as argument

I'm adding a box to add / update post screen. add_action( 'save_post', 'psd_upload_kaydet' ); add_action( 'add_meta_boxes', 'psd_upload' ); function psd_upload() { add_meta_box("psd-upload", "Bir ...
0
votes
1answer
103 views

How to make a function occurs for one time?

I have the following code in the functions.php file in my theme function my_func(){ echo "foo"; } add_action('admin_menu','my_func'); I assume this function "my_func" will be ...
1
vote
1answer
256 views

Does the switch_theme action run when you're upgrading a theme?

Did anyone test if this action is being executed on theme upgrade? Are there any other actions I could use to attach a theme uninstall function?
11
votes
3answers
1k views

get_template_part vs action hooks in themes

It seems to me both of these afford the opportunity for the end user to modify a theme without actually editing the themes files (via child themes). My question is, is one method preferred over the ...