Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MSF
/
msf-climate-hub
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
924efdfe
authored
2023-11-10 14:35:32 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
short
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
6e554108
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletions
wp-content/themes/msf-child/inc/shortcodes.php
wp-content/themes/msf-child/inc/shortcodes.php
View file @
924efdf
...
...
@@ -42,4 +42,30 @@ function advance_search($atts){
function
add_linebreak_shortcode
()
{
return
'<br />'
;
}
add_shortcode
(
'br'
,
'add_linebreak_shortcode'
);
\ No newline at end of file
add_shortcode
(
'br'
,
'add_linebreak_shortcode'
);
add_shortcode
(
'list_media'
,
'list_media'
);
function
list_media
(
$atts
){
ob_start
();
$args
=
array
(
'posts_per_page'
=>
-
1
,
'post_type'
=>
'attachment'
);
$pages
=
get_posts
(
$args
);
foreach
(
$pages
as
$page
){
$exclude_from_search
=
get_post_meta
(
$page
->
ID
,
'exclude_from_search'
,
true
);
if
(
$exclude_from_search
==
'0'
){
?>
<a
href=
'
<?php
echo
get_permalink
(
$page
->
ID
);
?>
'
>
<?=
get_the_title
(
$page
->
ID
)
?>
</a><br><br>
<?php
}
}
wp_reset_query
();
$output
=
ob_get_clean
();
return
$output
;
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment