ACS Richland Redesign

Wordpress

ACS Richland, a local section of the American Chemical Society, desired to modernize their website and made it mobile friendly. ACS Richland is a small section made up of busy volunteers, so a primary consideration for this website was for updating to be as simple and minimally involved as possible. I worked on streamlined, custom php code to create simple, clean organizational methods that did not involve plugins to future-proof against errors and minimize the amount of updating needed by the section.

Homepage Before
HTML

Homepage After
Wordpress + Elementor (Free)

Emphasis on easy access to wanted actions, clear navigation, improved usability for mobile and users with accessibility needs, improved alignment to ACS branding.

Improving functionality with simple PHP

Rather than add plugins that require maintenance and can create issues as PHP versions, Wordpress, and Elementor evolve, I decided to stretch out of my usual box to create simple PHP extensions that would serve to make the site easier to maintain. One simple example is displaying all attachments (PDFs) with a certain category (e.g. newsletters), in descending order. This way, a volunteer would only have to upload the newsletter, categorize it, and move on. They'd never have to edit the newsletter page.
/*
 * Shortcode to display attachments by category
 * E.g. [attachments_by_category category="15" orderby="name"]
 * Output will be a <ul><li><a href=[url]>Caption</a> (size)</li></ul>
 * For minutes orderby=name (default) because the files are YYYYMMDD.pdf
 * but for annual reports we orderby=date since they are uploaded in order
 */
function file_category_shortcode($attr, $content = null){
    $file_category = shortcode_atts (
        array(
            'category' => '',
            'orderby'  => 'name'
        ), $attr);
    $args = array(
        'post_type'      => 'attachment',
        'post_status'    => 'inherit',
        'posts_per_page' => -1,
        'orderby'        => $file_category['orderby'],
        'tax_query'      => array(
            array(
                'taxonomy' => 'media_category',
                'field'    => 'id',
                'terms'    => $file_category['category'] // term id
            )
        )
    );
    $query = new WP_Query( $args );
    if ( $query->have_posts() ) {
        echo '<ul>';
            while ( $query->have_posts() ) {
                $query->the_post();
                echo '<li><a href="' . wp_get_attachment_url() . '">' . get_the_title() . '</a> (' . size_format( filesize( get_attached_file( get_the_ID() ) ) ) . ')</li>';
            }
        echo '</ul>';
    }
    wp_reset_postdata();
} add_shortcode( 'attachments_by_category', 'file_category_shortcode' );

Back to Top