Viewing 8 posts - 1 through 8 (of 8 total)
Kent

Shortcodes – Where are the codes located?

I'm creating a new listing/profile page with elementorPro. Using the PP Shortcodes widget is not good enough. I need the shortcode strings so i can use with the text editor. Where or what files can i find those shortcode strings as well as the custom field shortcodes that i created?

Created: February 5, 2020 at 4:17 am

  • JamesD
    JamesD
    February 5, 2020 at 5:38 am

    Hello,
    “Where or what files can i find those shortcode strings…”
    Here’s a list of shortcodes for the theme:
    /DA9/_dating/functions.php

    • GENDER
    • AGE
    • GENDER-ICON
    • LISTINGDATA
    • PROFILEDATA
    • ZODIACSIGN

    /DA9/framework/new_class/ppt_6_shortcodes.php

    • premiumpress_elementor_template

    /DA9/framework/new_class/ppt_core.php

    • HOME_URL
    • ID
    • TITLE
    • EXCERPT
    • CONTENT
    • TAGS
    • IMAGE
    • IMAGES
    • GALLERY
    • VIDEO
    • VIDEOS
    • CATEGORY
    • COMMENTS
    • CUSTOMFIELD
    • CATEGORYIMAGE
    • CATEGORYICON
    • LIKES
    • AMENITIES
    • MAINMENU
    • HITS
    • USER-COUNTRY
    • USER-SINCE
    • USER-LASTONLINE
    • RIBBON
    • FIELDS
    • MEDIA
    • RATING
    • LOCATION
    • TIMELEFT
    • TIMESINCE
    • VISITORCHART
    • USERID
    • CONTACT
    • FAVS
    • IMAGEAUTHOR
    • LISTINGS
    • ADVANCEDSEARCH
    • CATEGORIES
    • MEMBERSHIP
    • DISTANCE
    • COUNTRY
    • CITY
    • SELLSPACE
    • D_CATEGORIES
    • D_SOCIAL
    • SOCIAL
    • FLAG
    • SCREENSHOT
    • HITCOUNTER
    • GOOGLEMAP
    • gallery

    “… as well as the custom field shortcodes that i created?”
    /DA9/framework/new_class/ppt_extra_cart.php

    • ADDCART
    • PRODUCT-PRICE

    Use the CUSTOMFIELD for custom field shortcodes like:
    Phone: [CUSTOMFIELD field=”phone”]
    Featured: [CUSTOMFIELD field=”featured”].
    All of the custom fields related to a listing are listed on the edit listing page, so you can find the custom field names there.


  • Kent
    February 5, 2020 at 9:35 pm

    Thank you very much!

    All the [SHORTCODES] are working great but i cant get the custom field shortcodes to work.

    Can you please give me the shortcode string for the following fields in the picture as an example.

    1. Phone:
    2. Email:
    3. Age:

    Thanks for your help!

    Attachments:
    You must be logged in to view attached files.

  • Kent
    February 28, 2020 at 6:04 pm

    @Mark

    What are the shortcodes for:

    1. Listing URL
    2. Author (ie. User Name at registration)

    Thanks

  • JamesD
    JamesD
    February 29, 2020 at 4:24 am

    Sorry Kent, didn’t receive an email on the response.

    Can you please give me the shortcode string for the following fields in the picture as an example.

    1. Phone:
    2. Email:
    3. Age:”

    Use the custom field name as the field param. Going by your image, these should work (respectively)…

    [CUSTOMFIELD field='custom-5']
    [CUSTOMFIELD field='custom-6']
    [AGE] or [CUSTOMFIELD field='daage']

    “What are the shortcodes for:

    1. Listing URL
    2. Author (ie. User Name at registration)”

    They do not exist that I’m aware of, you’ll need to come up with a custom solution.

    Here’s the code to add a couple shortcodes. Try adding this near the bottom of your child theme’s _function.php file:

    add_action( 'init', function() {
    	/** [LISTING_URL] Returns Page URL **/
    	add_shortcode( 'LISTING_URL', function( $atts = null, $content = null ) {
    		global $wp;
    		return home_url( $wp->request );
    	} );
    	/** [USERNAME] Returns "Author" Display Name **/
    	add_shortcode( 'USERNAME', function( $atts = null, $content = null ) {
    		global $userdata;
    		return $userdata->display_name;
    	} );
    } );

  • Kent
    March 7, 2020 at 3:13 am

    @Mark

    Thanks for the codes… BUT,

    The [LISTING_URL] works awesome

    [USERNAME] does not display.

  • JamesD
    JamesD
    March 7, 2020 at 4:33 am

    @Kent
    Note: Not sure if you’re referring to me or not, however I’m JamesD and not affiliated with PremiumPress, just a theme owner.

    “[USERNAME] does not display.”

    Strange. Works fine on my end.

    Try changing $userdata->display_name; to $userdata->user_login; and see if that helps. If not, then the only other suggestion would be to change USERNAME to something more unique in case that shortcode already exists.

  • JamesD
    JamesD
    March 7, 2020 at 4:39 am

    Petty mistake on my end, sorry.

    Use this one:

    	/** [USERNAME] Returns "Author" Display Name **/
    	add_shortcode( 'USERNAME', function( $atts = null, $content = null ) {
    		global $post;
    		return $post->post_title;
    	} );

Copyright © 2010-2020 PremiumPress Limited.

secure payments