the answer for all question about Oxygen Builder plugin and WordPress

[OFF-TOPIC] I am desperate trying to link one “entities list page” (courses) to


[OFF-TOPIC] I am desperate trying to link one “entities list page” (courses) to the course “detail page”, by using rewrite rules to link to the detail page, passing the course id as a parameter. It does not work, not sure why, please help!.

This is my rewrite rule:

function custom_rewrite_rules() {
add_rewrite_rule(‘curso/([^/]+)/?$’, ‘index.php?pagename=curso&idCurso=$matches[1]’, ‘top’);
}
add_action(‘init’, ‘custom_rewrite_rules’, 10, 0);

And this is the way I am trying to capture the parameter in the “course detail” page:

function get_basic_options($some_query_var, $db_table) {
global $wpdb;
$resultHTML=””;
$id = get_query_var($some_query_var);
$query = ” SELECT idCurso, name
FROM “.$wpdb->prefix.$db_table;
// echo $query;
$results = $wpdb->get_results($query);
$resultHTML.= ‘‘;
if ( $results ){
foreach ($results as $item){
if ($item->id == $id) $resultHTML.=’‘;
}
} else {
$resultHTML.=’

No entries.

‘;
}
return do_shortcode($resultHTML);
}


Source

Leave A Reply

Your email address will not be published.

Oxyrealm Docs