• Resolved sakthig

    (@sakthig)


    I am using a autoblog plugin which scrapes the content and creates the blog posts automatically.So i would like to create the button dynamically upon the post title
    My button name should be

    syntax :Keyword +Post title
    E.g: Download AAA Logo Software Developer Version
    Note:
    Here above,the “Download” is the keyword and “AAA Logo Software Developer Version” is the post title name.
    how can i make it work.Thanks in advance

    http://ww.wp.xz.cn/plugins/shortcodes-ultimate/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Vova

    (@gn_themes)

    You need to create shortcode which returns post title

    function my_shortcode_title( ){
       return get_the_title();
    }
    add_shortcode( 'post_title', 'my_shortcode_title' );

    and then use this shortcode inside of button

    [button] Download [post_title] [/button]
    Thread Starter sakthig

    (@sakthig)

    Thanks for help
    I have tried the code and button was drawn but it contains the title of "Download [post_title]" I think the variable value is not replaced with the proper value or the syntax has been thrown with no value.
    Thanks in advance.

    Thread Starter sakthig

    (@sakthig)

    Here is the screenshot link of the button
    http://www.anony.ws/i/2013/10/17/oI2CX.jpg

    Plugin Author Vova

    (@gn_themes)

    I’ve just uploaded new fixed version to the GitHub. You can get this file and replace your original file.

    Plugin Author Vova

    (@gn_themes)

    These changes will be included in next version. So you will be able to update plugin as before.

    Thread Starter sakthig

    (@sakthig)

    Fantastic Plugin.Awesome support.Worked 100%

    Plugin Author Vova

    (@gn_themes)

    Thank you =)

    Thread Starter sakthig

    (@sakthig)

    Vladimir:
    Really sorry for the disturb.But everything worked except the button link has been tarted to the base url than the targeted page.I have used the following code in the single page
    E.g

    <?php echo do_shortcode( ‘[button url=”http://www.sitename.com/product-page”%5D Download [post_title] Software[/button]’ ); ?>

    By clicking the link above in the button it lands to the base URL http://www.sitename.com not on http://www.sitename.com/product-page.
    What i made wrong.

    Plugin Author Vova

    (@gn_themes)

    Try this code

    <?php
    echo Shortcodes_Ultimate_Shortcodes::button( array( 'url' => 'http://www.sitename.com/product-page' ), 'Download ' . get_the_title() . ' Software' );
    ?>
    Thread Starter sakthig

    (@sakthig)

    Ya.This one worked perfect.I hope this way i can add more variables to this button (size,color).If you have time,please share the code (Example with variables usage)I am still beginner to this techie PHP stuff.Thanks.

    Plugin Author Vova

    (@gn_themes)

    This is just an array. Example:

    <?php
    $args = array(
       'url' => 'http://www.sitename.com/product-page',
       'color' => '#fff',
       'background' => '#fc0',
    );
    $text = 'Download ' . get_the_title() . ' Software';
    echo Shortcodes_Ultimate_Shortcodes::button( $args, $text );
    ?>
    Thread Starter sakthig

    (@sakthig)

    Suggestion worked,query resolved.Its time to thank Vladimir(Plugin Author) and close this thread.
    Note:
    To appreciate the work of the author, i have decided to link back to the author website from one of my blog.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Dynamic Button Name Generator’ is closed to new replies.