WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
Inser a SQL query in aisseop_class.php (7 posts)

  1. shamratdewan
    Member
    Posted 10 months ago #

    How can i run a sql query in aioseop_class.php. i understand the update issues but it would be great to run a sql query with $wpdb->get_results. when i insert it the page returns a blank while page.

    http://wordpress.org/plugins/all-in-one-seo-pack/

  2. Peter Baylies
    Member
    Plugin Author

    Posted 10 months ago #

    shamratdewan,

    I'd recommend against doing this for a number of reasons; what is your goal here, maybe we can find a way to do it that doesn't involve hacking the plugin, or doing custom SQL queries.

  3. shamratdewan
    Member
    Posted 10 months ago #

    hi, well I managed to run the query inside that function. I actually forgot to declar the var. However I also dont want to do that as its just a temporary fix.. I wanted to detect value of a var if yes then the title of that page needs to come from another table. which is running outside wp page or post using old get values on url. However, can you show me a bit details about custom query that can overwrite seo titles or meta values without touching plugin files

  4. Peter Baylies
    Member
    Plugin Author

    Posted 10 months ago #

    shamratdewan,

    All in One SEO Pack uses the WordPress Plugin API, which means that there are a lot of hooks for this functionality that you should be able to use. For example, you can add a custom title to a post programmatically by using the aioseop_title filter; there are also various filters for meta description, keywords, etc., all usable without having to modify any plugin code. Here's an example of how this works:

    add_filter('aioseop_title', 'sfwd_custom_title');
    
    function sfwd_custom_title($title) {
       if ( is_category( "CategoryName" ) ) {
            $title = "Custom Category Title";
       } elseif ( is_category( "CategoryName2" ) ) {
            $title = "Custom Category Title 2";
       }
       return $title;
    }
  5. shamratdewan
    Member
    Posted 10 months ago #

    that looks nice I will try this first thing tomorrow morning. ..

  6. shamratdewan
    Member
    Posted 10 months ago #

    thanks a lot

  7. Peter Baylies
    Member
    Plugin Author

    Posted 10 months ago #

    No problem; good luck with it, let me know how it goes!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.