Hello.
I have a comment related to this piece of code….
I displaying a list of posts (events) and everyting worked fine until I moved my apparent wordpress root – so the GUID is not refering to the location of the page anymore.
After the move, clicking on the title generates a 404 error.
what is your impression? is this a correct solution?
foreach ($events as $event) {
$class_item = ($event->time_end >= current_time('timestamp')) ? 'event_future' : 'event_past';
if ($ep_settings['emptylink'] == 0 && empty($event->post_content)) {
$event->permalink = '#' . $id . $this->list_id;
}
// was trying to display a list of posts (events) and everyting works
// Then I moved my apparent wordpress root - so the GUID is not refering to the location of the page anymore
// to be honest, I don't understand why $ob is used here - maybe it is the cause of the issue - I solved in another way
elseif(empty($ob->permalink)){
// some tests for the new code.... $list.=sprintf('<p>'.$event->guid.'<br />'.get_permalink($event->post_parent).'<br />'.get_permalink($event->ID).'</p>');
// this is the original code.... the problem is that the GUID is put in the HTML in the <a>. Results in 404 error
$event->permalink=$event->guid;
// this is the code I replace it with - it works.... Any thoughts? is this correct?
$event->permalink=get_permalink($event->ID);