WordPress.org

Ready to get started?Download WordPress

Forums

SEO Auto Linker
[resolved] SEO Auto Linker for custom fields (3 posts)

  1. sigsol
    Member
    Posted 2 years ago #

    Is it possible to have the plugin scan custom fields?
    I am using custom fields a lot for my site, most of the text comes from them.
    Thanks
    SS

    http://wordpress.org/extend/plugins/seo-auto-linker/

  2. chrisguitarguy
    Member
    Plugin Author

    Posted 2 years ago #

    It's very possible, but it's not something that's going to go into the plugin because it would very implementations specific.

    But here's a few ways you could do it. Where ever you use/echo out get_post_meta, run it through a filter:

    <?php echo apply_filters( 'add_seo_auto_linker', get_post_meta( $post->ID, 'testing', true) ); ?>

    Then you can hook into that filter in functions.php and run the content through the auto linking filter:

    <?php
    add_filter( 'add_seo_auto_linker', 'cd_wpforum_test' );
    function cd_wpforum_test( $content )
    {
        return pmgSeoAutoLinkerFront::content( $content );
    }
  3. imarap
    Member
    Posted 1 year ago #

    Hi, I know this post was already marked as resolved, but I need to use SEO Auto Linker with custom fields and I cannot make it work.

    I have tried your solution, however when I insert your code in a page template, the page cannot be displayed.

    I use both the advanced custom fields and the wordpress meta fields, none of them worked.

    <?php echo apply_filters( 'add_seo_auto_linker', get_field( 'field_name', $post->ID ) ); ?>

    <?php echo apply_filters( 'add_seo_auto_linker', get_post_meta( $post->ID, 'field_name', true) ); ?>

    Any ideas? Thanks for your time.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic