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
a4270407
authored
2023-11-20 15:20:56 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
date
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
141e18fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
wp-content/themes/msf-child/inc/extras.php
wp-content/themes/msf-child/inc/rest.php
wp-content/themes/msf-child/inc/extras.php
View file @
a427040
...
...
@@ -257,4 +257,31 @@ if ( ! function_exists( 'understrap_all_excerpts_get_more_link' ) ) {
}
}
add_filter
(
'excerpt_length'
,
function
(
$length
)
{
return
35
;
}
);
\ No newline at end of file
add_filter
(
'excerpt_length'
,
function
(
$length
)
{
return
35
;
}
);
function
wpmldp_translate_date_format
(
$date
)
{
//Create array with dates
$month_dates
=
array
();
$month_dates
[]
=
'1st'
;
$month_dates
[]
=
'2nd'
;
$month_dates
[]
=
'3rd'
;
for
(
$d
=
4
;
$d
<=
30
;
$d
++
)
{
$month_dates
[]
=
$d
.
'th'
;
}
$month_dates
[]
=
'31st'
;
//Register strings on String Translator
foreach
(
$month_dates
as
$month_date
)
{
do_action
(
'wpml_register_single_string'
,
'Date Formats'
,
'Month Date (WPML) - '
.
$month_date
,
$month_date
);
}
//Translate strings
if
(
in_array
(
$date
,
$month_dates
)
)
{
$date
=
apply_filters
(
'wpml_translate_single_string'
,
$date
,
'Date Formats'
,
'Month Date (WPML) - '
.
$date
);
}
return
$date
;
}
add_filter
(
'wp_date'
,
'wpmldp_translate_date_format'
,
10
,
1
);
\ No newline at end of file
...
...
wp-content/themes/msf-child/inc/rest.php
View file @
a427040
...
...
@@ -60,8 +60,8 @@ function pull_posts_for_post_list( $data ) {
if
(
!
$img
)
{
$img
=
get_post_meta
(
$post
->
ID
,
'photo_from_source'
,
true
);
}
error_log
(
$excerpt
);
$new_posts
[]
=
[
'date'
=>
get_the_time
(
' F j, Y'
,
$post
),
$new_posts
[]
=
[
'date'
=>
wp_date
(
' F j, Y'
,
get_post_timestamp
(
$post
->
ID
)
),
'article_author'
=>
$article_author
,
'author_title'
=>
$author_title
,
'author_company'
=>
$author_company
,
'href'
=>
get_permalink
(
$post
),
'title'
=>
$post
->
post_title
,
'text'
=>
$excerpt
,
'img_src'
=>
$img
];
...
...
@@ -116,7 +116,7 @@ function pull_posts_for_post_list( $data ) {
if
(
!
$img
)
{
$img
=
get_post_meta
(
$post
->
ID
,
'photo_from_source'
,
true
);
}
$posts
[]
=
[
'date'
=>
get_the_time
(
' F j, Y'
,
$post
),
$posts
[]
=
[
'date'
=>
wp_date
(
' F j, Y'
,
get_post_timestamp
(
$post
->
ID
)
),
'article_author'
=>
$article_author
,
'author_title'
=>
$author_title
,
'author_company'
=>
$author_company
,
'href'
=>
get_permalink
(
$post
),
'title'
=>
$post
->
post_title
,
'text'
=>
$excerpt
,
'img_src'
=>
$img
];
...
...
Please
register
or
sign in
to post a comment