PHP code example of tomk79 / px2-seo-utils

1. Go to this page and download the library: Download tomk79/px2-seo-utils library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tomk79 / px2-seo-utils example snippets


$conf->funcs->before_sitemap = array(

    // 〜中略〜

    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(
        /* プラグインの設定 (後述) */
    )),

    // 〜中略〜

);

    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(

        'robots' => array(
            // metaタグ robots の自動挿入を有効にします。
            'enable' => true,
        ),

    )),

<html>
<head>

$seoUtils = new \tomk79\pickles2\px2_seo_utils\main($px);
$tag = $seoUtils->robots()->tag(array(
    'follow'=>'no',
    'index'=>'',
    'archive'=>'',
));
echo $tag;

    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(

        'sitemapXml' => array(
            // sitemap.xml の自動生成機能を有効にします。
            'enable' => true,

            // ここに設定したパスへのリクエストをトリガーに、sitemap.xml が生成されます。
            'trigger' => '/index.html',

            // 生成した sitemap.xml の保存先のパスです。
            // `.px_execute.php` が置かれているディレクトリをルートとして設定します。
            'dist' => '/sitemap.xml',
        ),

    )),