Difference between revisions of "Timeline Express Pro Modifications"

m
no edit summary
m
m
Line 168: Line 168:
</syntaxhighlight>
</syntaxhighlight>


And there's also one more item to configure when using the POST method.  A dedicated page (WhatEverURL) needs to be created.  And the below code needs to be inserted to in order to only have the functionality run on the pages it is intended to run on;<syntaxhighlight lang="text">
// This If Function is TRUE if the requested Page is for the intended links
// When FALSE, the $CONTENT is simply returned as is with no changes
if ( basename(get_permalink()) == 'PageNameToCheck') // If the Page or Post name changes, it also needs to be changed in the link generated in the Timeline Express function above.
{
$post_id_from_post_header = $_POST['PostIdPassed'];
$post_id_from_get = $_GET['metapost_id'];
// This If Function is TRUE if the page was requested via a direct link or crawled by a robot.
if( is_null( $post_id_from_post_header ) )
{
$post_id_from_post_header = $post_id_from_get;
}
$content_of_custom_excerpt = get_post_meta( $post_id_from_post_header, 'announcement_custom_excerpt', true );
// This If Function is only TRUE if there is no announcement_custom_exerpt Field in the metapost Table for a post.
// When FALSE, an announcement_custom_exerpt Field in the metapost Table for a post exists.
if( is_null( $content_of_custom_excerpt ) )
{
$custom_excerpt_result_message = 'This post has no custom excerpt associated with it.';
$content = $content;
return $content;
}
else{
$content = 'Post ID from GET:' . $post_id_from_get . '<br><br>' . 'Post ID from HEADER:' . $post_id_from_post_header . $content_of_custom_excerpt;
return $content;
}
}
else{
$content = $content;
return $content;
    }
}
add_filter ('the_content', 'display_sources_and_additional_information');
</syntaxhighlight>