1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HowTo: Add XF Notices to a WordPress theme

A XenForo Notice is added with only a few lines of code

  1. LPH
    XenForo notices may be added to a WordPress child theme header file using only a few lines of code.

    2. /* Script to pull a notice from the XF */
    3. /** @var $notModel XenForo_Model_Notice */
    4. $notModel = XenForo_Model::create('XenForo_Model_Notice');
    5. $notices = $notModel->getNoticeById(23);
    6. echo $notices['message'];
    7. ?>
    Change the number within the getNoticeById parentheses to match the XenForo notice you want to show on the WordPress side of your website.