[Solved] I want to make a call in php that will create an for each post? [closed]

As per the wordpress documentation. This should get you started: <ul> <?php $args = array( ‘posts_per_page’ => 5, ‘offset’=> 1, ‘category’ => 1 ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <li> <a href=”https://stackoverflow.com/questions/21582661/<?php the_permalink(); ?>”><?php the_title(); ?></a> </li> <?php endforeach; wp_reset_postdata();?> </ul> And for further … Read more

[Solved] regular expression to replace div [closed]

This solution uses 2 Replace calls which might be OK if the code is not executed too frequently: string input = @”<div class=””tr-summaryinfo””>’ <p class=””tr-summaryitem””>test </> </div>”; string result = Regex.Replace(input, “<div class=\”tr-summaryinfo\”>(.*?)</div>”, “<ul class=\”tr-summaryinfo\”>$1</ul>”, RegexOptions.Singleline); result = Regex.Replace(result, “<p class=\”tr-summaryitem\”>(.*?)</p>”, “<li class=\”tr-summaryitem\”>$1</li>”, RegexOptions.Singleline); Note that you need ? in the patterns to avoid the … Read more

[Solved] Unordered List and fonts appearing differently in different browsers

The <details> element is not currently (11th May 2016) supported by IE and is an experimental feature in Firefox requiring a preference ‘flag’ to be set/enabled. Per MDN This feature is available since Firefox 47 behind the preference dom.details_element.enabled, defaulting to false, except on Nightly and Aurora versions (bug 1241750). Support for it is enabled … Read more

[Solved] PHP nested array into HTML list

What you are looking for is called Recursion. Below is a recursive function that calls itself if the value of the array key is also an array. function printArrayList($array) { echo “<ul>”; foreach($array as $k => $v) { if (is_array($v)) { echo “<li>” . $k . “</li>”; printArrayList($v); continue; } echo “<li>” . $v . … Read more