• csbecker

    (@csbecker)


    I’m trying to do something special with Shortcodes (what else is new) and I don’t have the facility with PHP as I would like, but I believe shortcodes is what will help me. I have a client’s website where they want to sell products, I have created a POST or PAGE for each product. I want to use shortcodes to dynamically build “Add to Cart” (PayPal) buttons that include the name of the Page or Post so I don’t have to create many buttons (like 400+). So is there a way to do something like this?
    Create a shortcode in my functions.php like the following:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    This line:
    <input type=”hidden” name=”item_name” value=”Trip Deposit – Page Title”>
    Is where I would like to dynamically put the website’s page’s title.

    Does this make sense and can you assist?

    I’m also wondering if I would have to change the double quotes within the echo to single quotes to make the shortcode work.

    Can anyone help me build this shortcode?

    Thanks! Chris

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic Page_Title in Shortcode’ is closed to new replies.