function sort_posts(id) {
    console.log("Executing function.");
    var value = document.getElementById("my-selection").value;
    console.log(value);

    var parentNode = document.getElementById("rows-parent");
    var instagramRow = document.getElementById("instagram-row");
    var podcastsRow = document.getElementById("podcasts-row");
    var articlesRow = document.getElementById("articles-row");
    if (value == 1) {
        parentNode.appendChild(podcastsRow);
        parentNode.appendChild(instagramRow);
        parentNode.appendChild(articlesRow);
    }
    else if (value == 2) {
        parentNode.appendChild(instagramRow);
        parentNode.append(articlesRow);
        parentNode.appendChild(podcastsRow);
    }
    else if (value == 3) {
        parentNode.append(articlesRow);
        parentNode.appendChild(podcastsRow);
        parentNode.appendChild(instagramRow);
    }
}
