The archive page is shown when a category is selected and typically has excerpts of each post in that category

WordPress hooks

Haven’t found any yet – do they exist???

Theme hooks

Look in your theme’s archive.php file – does it have any hooks?

Kleo theme example hook functions

//****************************************************************
//****************************************************************
//********** WP CATEGORY ARCHIVE PAGE - BEFORE CONTENT ***********
//****************************************************************
//****************************************************************
add_action( 'kleo_before_archive_content', 'odac_kleo_before_archive_content' );     //kleo_before_archive_content is a hook kleo has in its archive.php
function odac_kleo_before_archive_content( )
{
  
  //-----------------------
  //----- HTML OUTPUT -----
  //-----------------------
  
  $HtmlOutput = "";
  
  //----- DISPLAY THE CATEGORY TITLE -----
  if (is_archive())
  {
    $current_category = single_cat_title("", false);
    
    $HtmlOutput .= "<h1>$current_category</h1>";
  }
  
  echo $HtmlOutput;
}


//***************************************************************
//***************************************************************
//********** WP CATEGORY ARCHIVE PAGE - AFTER CONTENT ***********
//***************************************************************
//***************************************************************
add_action( 'kleo_after_archive_content', 'odac_kleo_after_archive_content' );     //kleo_after_archive_content is a hook kleo has in its archive.php
function odac_kleo_after_archive_content( )
{
  
  //-----------------------
  //----- HTML OUTPUT -----
  //-----------------------
  
  $HtmlOutput = "";
  
  //----- DISPLAY THE HOME AND BACK BUTTONS -----
  if (is_archive())
  {
    $HtmlOutput .= "THE END";
  }
  
  echo $HtmlOutput;
}
UK Electronic Designer
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published.