Okay Unser Marketing will den Content unserer Seiten Modular gestallten können das heist als Beispiel würde eine Seite wie folgt aussehen:
In dem Beispiel nutze ich das Widget 2mal. einmal in Zeile 2 und 4 . Nun lesen ich die Daten wie oben beschrieben aus und was ist nun wenn ich das widget in zeile 7 als Beispiel nochmal einfügen wie spreche ich die Felder an bzw lese sie richtig aus. ?
die Daten lese ich in der Template Datein wiefolgt ein:
[COLOR=#000080]function [/COLOR]abfragemediaquerry(){
[COLOR=#000080]global [/COLOR][COLOR=#660000]$wpdb[/COLOR];
[COLOR=#660000]$sql [/COLOR]= [COLOR=#008000]'select post_iD,meta_value from '[/COLOR].[COLOR=#660000]$wpdb[/COLOR]->[COLOR=#660e7a]prefix[/COLOR].[COLOR=#008000]'postmeta Where post_id in(198,163,167,302,311,314,317,320,323) AND meta_key= [/COLOR][COLOR=#000080]\'[/COLOR][COLOR=#008000]panels_data[/COLOR][COLOR=#000080]\'[/COLOR][COLOR=#008000]'[/COLOR];
[COLOR=#660000]$result [/COLOR]= [COLOR=#660000]$wpdb[/COLOR]->get_results([COLOR=#660000]$sql[/COLOR],[COLOR=#660e7a]ARRAY_N[/COLOR]);
[COLOR=#000080]return [/COLOR][COLOR=#660000]$result[/COLOR];
}
[COLOR=#660000]$array [/COLOR]= abfragemediaquerry();
[COLOR=#660000]$nexus [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]0[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$vortex [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]1[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$warden [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]2[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$juggernaut [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]3[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$smite [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]4[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$nova [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]5[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$swarm [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]6[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$rampage [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]7[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);
[COLOR=#660000]$colossus [/COLOR]= unserialize([COLOR=#660000]$array[/COLOR][[COLOR=#0000ff]8[/COLOR]][[COLOR=#0000ff]1[/COLOR]]);