Viewing 2 replies - 1 through 2 (of 2 total)
  • A few of my snippets:

    uploads_url (Sortcode, PHP code)

    $upload_dir = (array) wp_upload_dir();
    if ( isset($upload_dir['baseurl']) && !empty($upload_dir['baseurl']) )
    	echo $upload_dir['baseurl']; }
    else
    	// your fallback

    home_url (Sortcode, PHP code, vars: path,scheme)

    echo home_url("{path}", "{scheme}");

    …imagine what you can do 😉

    F.e: you can make a snippet for bloginfo (untested):

    bloginfo (Sortcode, PHP code, vars: key)

    echo bloginfo("{key}");

    or

    bloginfo (Sortcode, PHP code, vars: key,echo)

    if ( "" !== "{echo}" )
    	echo get_bloginfo("{key}");
    else
    	get_bloginfo("{key}");

    I use a lot: antispambot, permalink, google maps, Wikipedia, Google links…
    Great plugin 😉

    hi am new to coding in php and snippets, if I want to dynamically get my site_url and place it in an image <img src=”{site_url}/images/test.jpg” how would I define the snippet? thanks so much

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Post Snippets] Sitename’ is closed to new replies.