Support » Plugin: All in One SEO Pack » customize title and meta description based upon ?argument

  • Resolved koniahin

    (@koniahin)


    This is perhaps an odd question, but I would like to know if there is a way to customize the title and meta description based upon an argument accompanying the URL?

    Example:

    http://www.mysite.com/somepage – normal situation, takes on whatever is configured in the page’s SEO parameters

    http://www.mysite.com/somepage?key=balderdash – To make the page title and description as relevant as possible I wish to pass it an argument and if that argument exists change the title to the argument.

    Something like this which I did for the h1 header title:

    $key = ($_REQUEST[‘key’]);
    if ( $key ) { ?>
    <h1 class=”entry-title”><?php echo $key; ?></h1>
    <?php } else { ?>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    <?php } ?>

    If it means hacking a few lines of code I’m good with that so long as I know what file and the lines/details. Tx

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    This can be done with our API hooks: https://semperplugins.com/documentation/aioseop_title/

    koniahin

    (@koniahin)

    Thank you, I looked at the api hooks page, then through aioseop_class.php. Unfortunately I don’t enough understanding of wordpress framework and classes to handle this.

    add_action( ‘aioseop_title’, ‘change_wordpress_seo_title’ );
    function change_wordpress_seo_title( $title ){
    $title = ‘modified title’;
    return $title;
    }

    Where would I add these and what do the other lines in the class file mean? I looked through the file. Line 886 has something with generate_descriptions and 1801: if ( ! empty( $aioseop_options[‘aiosp_cap_titles’] ).

    Version: 2.3.9.1

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘customize title and meta description based upon ?argument’ is closed to new replies.