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;
}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *