This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
template-tag-help.htm
81 lines (62 loc) · 2.73 KB
/
template-tag-help.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<title>Template Tag Help</title>
<style type="text/css">
<!--
body { font-family: Lucida Grande, Verdana, sans-serif; }
p { font-size: 13px; }
code, pre { font-size: 15px; background:#f0f0f0; padding:4px; line-height:23px; }
-->
</style>
</head>
<body>
<div style="width:700px; margin:50px auto 50px auto;">
<h3><strong>Template Tags</strong></h3>
<p>Note: there's an admin option to ignore the tags which needs to remain unticked when you want to use them.</p>
<p>Instructions: Place tag (1) in the header, place tag (2) where you want the players to be.</p>
<br /><br />
<p>(1). <strong><code>mp3j_addscripts( $style )</code></strong></p>
<p>Loads the player's javascript and CSS files into the page header, and allows you to set a stylesheet. This tag must be placed above wp_head(), and must be used to ensure scripts will be loaded for players set via template tags.</p>
<ul>
<li><p>$style can be either a URI to a stylesheet, or 'styleA', 'styleB', 'styleC', 'styleD' to use one available from admin. Defaults to current admin setting if not specified.</p></li>
</ul>
<br />
<p>(2). <strong><code>mp3j_put( $shortcodes )</code></strong></p>
<p>Adds player(s) where the tag is placed in the theme. Can be used multiple times.</p>
<ul>
<li><p>$shortcodes is a string containing any player shortcodes and html</p></li>
</ul>
<br /><br />
<h3>Example</h3>
<p>Play 5 random library tracks on the posts index page</p>
<p>Put this in header.php above wp_head()</p>
<pre><code><?php
mp3j_addscripts();
?></code></pre>
<br />
<p>Put this in index.php</p>
<pre><code><?php
mp3j_put( '[mp3-jplayer tracks="FEED:LIB" pick="5"]' );
?></code></pre>
<br />
<p>Always use <code>if ( function_exists() ) {}</code> to check tags exist before running them incase the plugin gets deactivated.</p>
<br /><br />
<h4>The following tags are not necessary but can be used:</h4>
<p><strong><code>mp3j_grab_library()</code></strong></p>
<p>Returns an array of all the mp3's in the library with their 'filenames', 'urls', 'titles', 'excerpts',
'descriptions', and original ID (not attachment). Can be used anywhere.</p>
<br />
<p><strong><code>mp3j_debug()</code></strong></p>
<p>Prints some info from the plugin to the browser's source view (CTRL+U or Page->view source) about
the page that just ran. Can be useful for debugging when customising templates.</p>
<br /><br />
<h4>Retired tags</h4>
<p>These tags have no use anymore, setting them has no effect.</p>
<p><strong><code>mp3j_flag( $set )</code></strong></p>
<p><strong><code>mp3j_set_meta( $tracks, $captions )</code></strong></p>
<br />
<br />
<hr /><br /><br />
</div>
</body></html>