How to add meta description to custom pages

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
RaiderKnight
Registered User
Posts: 11
Joined: Thu Oct 21, 2021 1:37 am
Location: Canada, Qc
Name: Raider Knight
Contact:

How to add meta description to custom pages

Post by RaiderKnight »

Hi,

I followed this tutorial (Knowledge Base - Add a New Custom Page to phpBB) and everything works except for my meta tags.
description is empty, I know I didn't add anything... (because I don't want to make 40 custom_overall_header.html)

How to add a custom description via the php file?

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('My Title');

$template->set_filenames(array(
    'body' => 'mypage.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
Last edited by thecoalman on Thu Dec 30, 2021 11:01 pm, edited 1 time in total.
Reason: Moved to phpBB Custom Coding
I don't follow the bible but the source code.
Post Reply

Return to “phpBB Custom Coding”