How to expire guest users after 1.5 hours logged in?

In your single.php template file: <?php if (has_post()) { the_post(); $user = wp_get_current_user(); $hasPermission = in_array(‘subscriber’, $user->roles); // or maybe instead of a role, you can check for your custom permission: // $hasPermission = current_user_can(‘view_access_codes’); $postTime = get_post_time(‘U’, true); $timeThreshold = time() – 60 * 60 * 1.5; $hasTimePassed = $postTime < $timeThreshold; if (!$hasPermission … Read more

Move static site to WordPress [closed]

There are many sites that can help you become more familiar with how WordPress works. The WPBeginner site (search for it) is one of them. There are tons of end-user-level tutorials. You don’t have to be a developer to use WordPress. You can use the default theme to get started. Or look for a theme … Read more

Display a list of posts corresponding to a category

As an alternative, consider using get_posts()? get_posts() It will require other changes to your code but you can easily create a query to include Categories, and then foreach through the results. Update: Here’s an equivalent to your code written with get_posts(). Take a copy of your own code first but the below would replace it … Read more

I need css code to divide my webpage sections into two columns

First, move your headings into their sections, so your structure looks more like this: <main> <section> Heading Here Cards Here </section> <section> Heading Here Cards Here </section> </main> Then you can do this in a few different ways with CSS. The simplest way is to add a class to each section and then float the … Read more