didn't add file
This commit is contained in:
parent
8aed3b1727
commit
e6e91e3eb6
23
docs/en_US/media-embed-template-tags.html
Normal file
23
docs/en_US/media-embed-template-tags.html
Normal file
@ -0,0 +1,23 @@
|
||||
<h1>Media Embedding Template Tags</h1>
|
||||
|
||||
<p>
|
||||
<em>ComicPress Core</em> provides a handful of template tags to access the media attached to each post.
|
||||
</p>
|
||||
|
||||
<h2>M()</h2>
|
||||
|
||||
<p>
|
||||
<code>M()</code> retrieves the attachment info from the current post.
|
||||
Attachment info is returned as an array of IDs that the various backends can identify and work with:
|
||||
</p>
|
||||
|
||||
<pre class="prettyprint lang-php">
|
||||
// we're in a Loop, so grab the current post's media and embed it
|
||||
foreach (M() as $image) { echo EM($image); }
|
||||
|
||||
// we have a post and want its media
|
||||
$first_post = R('first');
|
||||
foreach (M($first_post) as $image) { echo EM($image); }
|
||||
|
||||
var_dump(M());
|
||||
</pre>
|
Loading…
Reference in New Issue
Block a user