Support » Fixing WordPress » Adding shortcode each time php loops

  • Resolved DA2206



    I am currently trying to display a shortcode box each time a php loop runs. This box will contain various images and text selected by the query.

    Extremely new to WP and looking for some advice.

    Current code:

    $imageQuery = "SELECT * FROM X WHERE City LIKE 'City' ORDER BY CityCode";
    $result = mysql_query($imageQuery) or die(mysql_error());
    while( $row=mysql_fetch_row($result) )
    echo do_shortcode[styledbox type="general shaded"  ].$row[1].[/styledbox];

    Essentially a query that i am looking to create a new box each time it runs, with field information displayed relating to the row the loop is on, forming a list of boxes.

    Any help much appreciated,

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding shortcode each time php loops’ is closed to new replies.