











































🎯 How to Add a Looping Marquee Slider in WordPress Without a Plugin.
Do you want to build a looping image or content slider in WordPress without needing third-party plugins? You’re at the right destination. In this brief guide, we’ll demonstrate how to make use of a custom shortcode and Elementor to produce a looping marquee slider.
Ideal Use Cases
- ✅ Showcase tech stack logos
- ✅ Scroll client logos
- ✅ Show team member avatars
- ✅ Marquee testimonials or quotes
- ✅ Display sponsors or partners
- ✅ Auto-loop your products
🔧 Step 1: Add the Custom PHP Code
(Or better, use a simple custom plugin or Code Snippets)
You’ll need to insert the following function into your theme’s functions.php
file or via a code snippets plugin:
Goto Appearance

Goto Theme File Editor

Goto function.php file

Add this code in function.php file
function looping_marquee_shortcode($atts, $content = null) {
$default_atts = shortcode_atts(array(
'speed' => '20s',
'direction' => 'left',
'pause' => 'true',
'gap' => '0px',
'font_size' => 'inherit',
'color' => 'inherit',
'background' => 'transparent',
'height' => 'auto',
'img_height' => '100px',
'align' => 'center'
), $atts);
$horizontal = in_array($default_atts['direction'], ['left', 'right']);
$reverse = in_array($default_atts['direction'], ['right', 'down']) ? 'reverse' : 'normal';
$pause = $default_atts['pause'] === 'true';
$id = 'marquee_' . uniqid();
ob_start(); ?>
🔧 Step 2: Use Shortcodes in Elementor or WP Editor:
For left direction use in [ ]
looping_marquee
For right direction use in [ ]
looping_marquee direction="right"
🛠 Full Attribute Options
Attribute | Type | Description |
---|---|---|
direction | text | left, right, up, down |
speed | duration | e.g. 15s , 25s , 8s |
pause | true/false | Pause on hover |
gap | CSS unit | Spacing between items |
img_height | CSS unit | Max image height |
font_size | CSS unit | Font size for any text |
color | color | Text color |
background | color | Background color |
height | CSS unit | Fixed height for vertical scroll |
align | top, center, bottom | Alignment for items |