Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #230728

    Hi!

    As many others I want to edit the 404. I read the topics here in the support where you tell in 1 sentence to “edit 404.php in the “enfold folder”

    So I find within the php the code:

    
    <?php 
    				do_action('avia_404_extra'); // allows user to hook into 404 page fr extra functionallity. eg: send mail that page is missing, output additional information
    			?>

    Would be great that s.o would explain what to do when I want to hook in the page like the 404.php saya.

    Thanx a lot!

    Stefan

    #230748

    Hi simpson199!

    If you aren’t familiar with actions it would be easier for you to edit the file directly. You can do so in a child theme so that it doesn’t effect the core theme files and keeps it update safe.

    Cheers!
    Devin

    #237782

    thanx devin, not what I expected but it seems that you can’t do anything from the theme-team due to wordpress issues…

    • This reply was modified 10 years, 8 months ago by simpson199.
    #237818

    Hi!

    This article: https://codex.wordpress.org/Function_Reference/add_action gives you a quick overview. I.e. add this code to your functions.php file

    
    function avia_extra_404_content() {
     echo "<h2>My custom html content</h2>";
    }
    add_action( 'avia_404_extra', 'avia_extra_404_content' );
    

    and the action will add the sentence “My custom html content” to the 404 website. You can also use the avia_extra_404_content function to execute shortcodes or to add some other custom text/code to the page.

    Best regards,
    Peter

    #256522

    Hi Peter!

    I see this is complicated with 404 pages, but your info helped me. Thanx a lot!

    Stefan

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘404-hook-in the-php’ is closed to new replies.