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

Is there a problem connecting to the MongoDB server?

I am having trouble connecting to the MongoDB server using the link provided below. I have double-checked the password and dbName, but it still won't connect. Can someone please assist me with this? const mongoose = require('mongoose'); ...

What is the best way to selectively adjust object parameters in unit testing?

In my module, I have an object with several parameters. I want to rewire only specific parameters of this object. Here is a snippet from my 'module.js' file: var obj = { param_A: 'valueA', param_B: 'valueB', param_C: &a ...

Creating audio streams using react-player

I am currently working on integrating the react-player component from CookPete into my website. However, I am facing a challenge in setting up multiple audio streams. Additionally, I want to include both DASH and HLS video streams but adding them as an arr ...

Using Ajax with Controller Action in Yii2

As a newcomer to programming, I am facing an issue where I need to call a function when the user inputs data and clicks the submit button. Although I am working with Yii2, I lack experience in Ajax. Despite my efforts, the controller action is not being tr ...

Having issues with implementing the Bootstrap form-check-inline feature

I have been attempting to utilize the form-check-inline feature from Bootstrap Forms without success, as it seems to be stacking checkboxes vertically instead of inline: This is the code snippet I am working with: <h1>Create Patient</h1> < ...

Experimenting with the speechSynthesis API within an iOS webview application

I'm currently working on developing an app that features TTS capabilities. Within my webview app (utilizing a React frontend compiled with Cordova, but considering transitioning to React Native), I am implementing the speechSynthesis API. It function ...

issue with manipulating hidden field on the client side

After some troubleshooting, I discovered an issue with a hidden field in my form. Despite changing the value using JavaScript right before submitting the form, on the server side it appeared to be null or empty. The Request.Form["hidAction"] showed as em ...

Utilizing JQuery Ajax to dynamically replace elements using JQuery functions

My issue is as follows... I am using AJAX and jQuery to populate a form. When the user makes a selection from a dropdown menu, AJAX retrieves data based on the choice and populates the form with this data. Sometimes, new elements are created when the AJA ...

Ways to display a US map using d3.js with state names positioned outside each state and pointing towards it

Currently, I am working with d3.js and d3-geo to create a map of the USA. My goal is to display the names of some states inside the state boundaries itself, while others should have their names positioned outside the map with lines pointing to the correspo ...

Step-by-step guide on incorporating an external JavaScript library into an Ionic 3 TypeScript project

As part of a project, I am tasked with creating a custom thermostat app. While I initially wanted to use Ionic for this task, I encountered some difficulty in integrating the provided API into my project. The API.js file contains all the necessary function ...

I am unable to halt the relentless stream of asynchronous events

Struggling to retrieve an array using a loop in the asynchronous environment of nodejs. Check out my code below: getDevices(userIDs, function(result) { if (result) { sendNotification(messageUser, messageText, result); res.send("Success"); } else { ...

Show only the image source (img src) and do not display the audio and video sources using jQuery

In my code, I need the following conditions to be met: when an image is posted from the backend, the video and audio sources should automatically hide; when a video is posted, the image and audio sources should hide; and when an audio file is posted, the v ...

Ensuring the modal is stored in one central location (Bootstrap)

I'm currently working on a website project using bootstrap, and I need to incorporate the same modal across all pages. Right now, I find myself duplicating the entire code in each HTML file to make it accessible on every page. However, this method is ...

Using jQuery to Retrieve Items from an Object Contained in .val()

If I use the .val() method and get a string representation like this: { "dept_catg_grp_nbr":"239", "dept_catg_grp_desc":"TABLE TOP GROUP" } What is the best way to access each of the individual elements? ...

Accordion content in motion

After creating an accordion, I wanted to enhance the user experience by adding a transition effect whenever they click on the accordion header. Even though I included height: auto and transition in the accordion container, it did not seem to have any impa ...

Unlocking the potential of Object[value] in JavaScript/jQuery: A guide to extracting its value

I have a table named 'mytable' with the following structure: <tr> <td><input type="checkbox" name="check[]" value="11"></td> <td>11</td> <td>2014-11-06 18:49:26</td> < ...

Troubleshooting my nodejs websocket chat for message sending glitches

The chat system is built on nodejs using websockets from socket.io library. While I have a client that also utilizes websockets from socket.io, I'm facing challenges in making the two communicate effectively. The issue seems to be with the client not ...

Toggle Button Control

In my PHP file, I have a submit button for the form coded like this: <input type="submit" name="submit" value="submit" disabled="true" /> Next, I initiate an asynchronous request using a request object, document.getElementById("username").onblur= ...

unable to decrease the gap between the rows of the table

I'm currently developing an application that involves a table with rows and columns, along with a checkbox container arranged as shown in the image below: https://i.stack.imgur.com/QoVrg.png One issue I'm facing is getting the letters A, B, C, ...

Failure to trigger jQuery.ajax success function on Windows XP operating system

Snippet: $.ajax({ type: "POST", url: "students/login", data:{"data[Student][email]":_email,"data[Student][password]":_password}, beforeSend: function(){ $("#confirm").text(""); }, error: function (xhr, status) { ale ...