jfox77
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: best way to customize core functions like wp_update_postFigured it out! I needed to pass $post_ID into my custom function and not use the loop in the function.
function dci_email_answer($post_ID) { //just do your stuff } add_action('publish_post', 'dci_email_answer');Forum: Fixing WordPress
In reply to: best way to customize core functions like wp_update_postI tried this out but nothing seems to happen. In the documentation it mentions “Action function arguments: post ID”. Do I need to pass an ID? If so what is the syntax to grab the ID and call add_action?
Here’s what I have in my theme’s functions.php file so far:
function dci_email_answer() { if (have_posts()) : while (have_posts()) : the_post(); $strMailTo = 'julie@fmywebsite.com'; $subject = 'Answer from mywebsite.com'; $email = 'info@mywebsite.com'; $mailBody = "Thank you for submitting a question! Click here to view the answer. <br /><br /> " . the_permalink(); mail($strMailTo, $subject, $mailbody, "From: $email"); header("Location: http://www.mywebsite.com"); endwhile; endif; } add_action('publish_post', 'dci_email_answer');Forum: Fixing WordPress
In reply to: best way to customize core functions like wp_update_postThanks, dralezero! I was thinking it was something along those lines. I’ll give it a shot!
Forum: Fixing WordPress
In reply to: The requested URL /login was not found on this server.Thank you, songdogtech for saving the day! I was locked out of my admin and my htaccess file was corrupt so none of my permalinks were working. I created a fresh htaccess file, with permissions set to 644 and the following code:
RewriteEngine on <IfModule mod_rewrite.c> RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>That fixed things so I could get back into my admin and my permalinks were restored.