Placing the date of each blog post at the end of the excerpt

Currently, there is a grid section on the homepage of our site showcasing the two most recent blog posts. I am looking for a Javascript solution to relocate the date to the bottom of each block, outside of the border. For reference, you can visit the following link:

Here is the current structure:

<div class="et_pb_column et_pb_column_4_4">

  <div class="et_pb_blog_grid_wrapper">
  
    <div class="et_pb_blog_grid clearfix et_pb_bg_layout_light blog-section" style="position: relative; height: 400px;">

    <article id="post-226" class="et_pb_post et_pb_no_thumb post-226 post type-post status-publish format-standard hentry category-uncategorized" style="position: absolute; left: 0px; top: 0px;">


      <h2><a href="http://abundancepractice-building.flywheelsites.com/what-you-learned-in-grad-school-is-ruining-your-website-and-10-ways-to-fix-it/">What You Learned In Grad School is Ruining Your Website (and 10 ways to fix it)</a></h2>

        <p class="post-meta">  Jun 5, 2015  </p>Blog excerpt text...        
    </article> <!-- .et_pb_post -->

My goal is to have the p.post-meta move to the bottom of each block in the grid. While I have attempted some JavaScript solutions, here's what I have tried thus far:

jQuery(function($){
$( ".post-meta:nth-child(1)" ).appendTo(".et_pb_post.et_pb_no_thumb:nth-    child(1)");
$( ".post-meta:nth-child(2)" ).appendTo(".et_pb_post.et_pb_no_thumb:nth-child(2)");
});

Additionally, another method I have explored is as follows:

jQuery(function($){

if ($('body').hasClass('et_pb_blog_grid')) {
$('.et_pb_post p')
.each(function() {
  var n = jQuery(this).find(".post-meta").html();
  $(n).clone().insertAfter(jQuery(this).find('.et_pb_post.et_pb_no_thumb'));
});
}

});

Answer №1

No JavaScript is necessary for this task.

Simply adjust the template layout by relocating

<?php the_excerpt(); ?>

prior to the post date.

Revision:

Access your website's homepage through the WordPress admin area and identify the template it utilizes.

Next, navigate to your theme's folder and locate the corresponding template file which should be labeled as follows:

<?php
/*
  Template Name: Homepage
 */
?>

This is the file you will need to modify

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When developing a multi-page application using React, encountering the error "TypeError: Cannot read property 'pathname' of undefined" may indicate an issue

I am facing an issue while trying to develop a multi-page application using react-router. As I am new to React, I find it difficult to explain the problem clearly. My goal is to incorporate a login page into the application. Suggestions and alternative app ...

AJAX and Java combination causing issues with logging out in the system

I am working with AJAX using jQuery to trigger a function when clicking a link with the ID logOut. Here is the AJAX code: $("#logOut").click(function(){ $.ajax({ url: "Logout" }); }); This AJAX function calls my Java Servlet shown below: /** ...

Generating an array of objects based on a specified condition

I am working on creating an array of objects. I want to add objects based on a condition, but instead of not adding the object in the array, it is adding false. I have attempted the following: const flag = false; const list = [ { key: 'abc&a ...

Mastering Backbone views and router functionality is essential for building scalable and efficient web

In my code, I have a series of page states that mimic the steps of a shopping cart checkout process. The first set of code sets up the ItemsCollection, ItemsView, and ItemsApp in Backbone.js. var ItemsCollection = Backbone.Collection.extend({ model: I ...

Is there a method in CSS animations that allows for endlessly repeating successive animations in a specified sequence?

While working with CSS animations, I encountered a challenge of making two animations occur successively and repeat infinitely without merging keyframes. Is there a way to achieve this using only CSS? If not, how can I accomplish it using JavaScript? I a ...

What could be causing the JQuery date picker to fail to load on the initial ng-click event?

I am encountering an issue with a JQuery UI date picker that is loaded through ng-click using the code below: Input: <input type="text" id="datepicker" autocomplete="off" ng-model="selectedDate" ng-click="showDatepicker()" placeholder="(Click to sele ...

Is it possible in Angular to generate a module and component without including a CSS file in a single command?

Is it possible to generate a Module linked to a component without automatically creating a css file? For example, the default method I've been using involves: ng generate module name / ng generate component name This results in the typical componen ...

Expand the accordion to reveal all the content

I'm facing an issue with my accordion where a scrollbar appears in every content section. To fix this, I tried setting overflow: hidden in the CSS: .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: hidd ...

Match rooms using Socket.io

I am utilizing the opentok and socket.io packages in an attempt to establish 2 distinct "groups". Successfully, I have managed to pair up individual users in a 1-to-1 relationship. However, my goal is to create two separate groups of users. For instance, ...

Electron framework experiencing compatibility issues with JQuery

I am currently attempting to integrate jQuery with the electron framework using electron fiddle. However, it seems that jQuery is not functioning correctly and animations are not being executed. For reference, you can check out the example: https://www.w3s ...

Is there an easy method for extracting URL parameters in AngularJS?

Hello, I'm new to Angular and coming from a background in PHP and ASP. In those languages, we typically read parameters like this: <html> <head> <script type="text/javascript"> var foo = <?php echo $_GET['foo&apo ...

The process of incorporating types into Node.js and TypeScript for handling req and res objects

Check out the repository for my project at https://github.com/Shahidkhan0786/kharidLoapp Within the project, the @types folder contains a file named (express.d.ts) where I have added some types in response. The (express.d.ts) file within the @types folde ...

"Step-by-step guide to building a webgrid or table to organize and display your

These are the HTML codes I have created: <table> <tr> <td><label style="text-align:left">Product Code:</label></td> <td><input type="text" id="productCode" value="" /> </td> </tr> & ...

What method sits snugly between prepend() and append()?

Just a quick question I have. I am attempting to align an element with my target. Usually, we use prepend (before the target) and append (after the target). Is there something similar that allows us to position that element directly on top of what we are ...

The server's file URLs are modified within the page source of a WordPress site

I've been attempting to integrate Adsense code into a WordPress blog at demonuts.com. I placed the Google code in the TEXT WIDGET provided by WordPress. However, upon running the website, I noticed that the URLs for .js, .css, or .png files are being ...

encounter with file compression using gzip

Currently, I am facing an issue with zipping files using jszip because the backend can only unzip gzip files, not zip files. My front end is built using vue.js. let zip = new jszip(); zip.file(fileToCompress.name, fileToCompress); let component = t ...

Substituting text in a document by utilizing two separate arrays: one holding the original text to be found and another storing the corresponding text for

I am facing a challenge with replacing specific text strings in a file. I have two arrays - one containing the strings that need to be located and replaced, and the other containing the replacement strings. fs.readFile("./fileName.L5X", "utf8", function( ...

Animate the appearance of list items sequentially using CSS animations

Is there a simpler way to achieve the effect of having list items slide in one after the other? The CSS method provided here seems quite intricate. #nav ul.is-visible{visibility:visible;opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transfo ...

What is the best way to compile TypeScript files without them being dependent on each other?

I have created a TypeScript class file with the following code: class SampleClass { public load(): void { console.log('loaded'); } } Now, I also have another TypeScript file which contains functions that need to utilize this class: // ...

The node.js system automatically restarts an API call when a timeout occurs

Current Setup: I am using a combination of sails.js for the backend API and React for the frontend. The communication between the frontend and backend is handled by the fetch API. Scenario: Within some of my API endpoints, I need to run an external file ...