WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: All in One SEO Pack] New Macro for %parent_category% ?? (2 posts)

  1. shutterdown
    Member
    Posted 3 years ago #

    So I'm trying to figure out a much asked question. How can I hack the plugin to include a macro for parent categories in title tags?

    For example, I have the following structure in one category:

  2. Category
  3. -

  4. Subcategory
  5. --

  6. Sub 2
  7. I would like my category title tags to display

    <title>Sub 2 | Subcategory | Blogname</title>

    Example for a site shutterdown magazine would be:

  8. Photos
  9. -

  10. Nashville Pics
  11. --

  12. Limelight
  13. I would like it to display

    <title>Limelight | Nashville Pics | Shutter Down Magazine </title>

    Single parent, single child

    For ease of use I would like to plug it in as a macro %parent_category%

    Any ideas? Work-arounds?

  • shutterdown
    Member
    Posted 3 years ago #

    I added the following to line 708 in aioseo.class.php but get only "array" in the place where the category parent should be...

    $title = str_replace('%category_parent%', get_the_category($category->category_parent), $title);

    Any ideas?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags