AZ Managed IT
Forums
Connect, Share, Solve – Empowering IT Solutions Together!
Recent Posts
-
[REQUEST] · Issue #864 · projectM-visualizer/projectm
By azmanagedit , 8 months ago
-
Option 1: Enable via functions.php
You can add a snippet of code to your theme's functions...
By azmanagedit , 9 months ago
-
dnn 4 and bonosoftmulti page content plugin
Bonosoft Multi Page Content for DNN 3.x Created by ...
By azmanagedit , 9 months ago
-
Moving Away from AWS After Disappointing Support Experience
Hey everyone,I wanted to share my recent experience wit...
By azmanagedit , 10 months ago
-
My Negative Experience with Visual Design Inc.
I feel compelled to share my unfortunate experience wit...
By azmanagedit , 10 months ago
-
Disable the product magnifier in Elementor
To disable the product magnifier in Elementor, you can ...
By azmanagedit , 10 months ago
-
How to enable Cross-Origin Resource Sharing (CORS) g...
By azmanagedit , 10 months ago
-
Yes, it’s possible to give access to specific pages on ...
By azmanagedit , 11 months ago
-
RE: Need Advice on Protecting and Promoting My WordPress Plugins
I guess the obvious thing to ask: sequii2016 (@sequ...
By azmanagedit , 11 months ago
-
https://wordpress.org/ Need Advice on Protecting and Promoting My WordPress Plugins
James Huff (@macmanx) 1 hour, 7 minutes ago ...
By azmanagedit , 11 months ago
Online Members
No online members at the moment
WordPress plugin - YouTube Latest Videos Plugin
YouTube Latest Videos Plugin
This WordPress plugin fetches and displays the latest videos from a specified YouTube channel.
Installation Instructions:
-
Download the Plugin:
- Download the
youtube-latest-videos.zip
file.
- Download the
-
Install the Plugin:
- Log in to your WordPress admin dashboard.
- Navigate to Plugins > Add New.
- Click on Upload Plugin.
- Choose the
youtube-latest-videos.zip
file and click Install Now. - After installation, click Activate to activate the plugin.
-
Configure the Plugin:
- Open the
youtube-latest-videos.php
file in your code editor. - Replace
YOUR_YOUTUBE_API_KEY
with your actual YouTube Data API key. - Replace the channel ID in the code with the desired channel ID.
- Open the
-
Use the Shortcode:
- Add the shortcode vcf_latest_videos to any post or page where you want to display the latest videos from the specified YouTube channel.
- Example:Canadian Prepper – World War 3 – AZ Managed IT Service LLC Forum
-
Key Changes Made:
- Dynamic Channel ID: The
vcf_display_latest_videos
function now accepts an attributechannel_id
from the shortcode, allowing you to specify different channels. - Default Channel ID: If no channel ID is provided, it defaults to the one you previously specified.
Using the Shortcodes:
You can now use the following shortcodes to display videos from different channels:
-
Default Channel:
vcf_latest_videos
-
Another Channel:
vcf_latest_videos channel_id="CHANNEL_ID_HERE"
Example Usage:
-
To display videos from the default channel:
vcf_latest_videos
-
To display videos from another channel (replace
CHANNEL_ID_HERE
with the actual channel ID):vcf_latest_videos channel_id=""
Instructions for Use:
-
Create/Update the Plugin File:
- If you have already created the plugin file, update it with this new code. If not, create a new file named
youtube-latest-videos.php
and paste this code into it.
- If you have already created the plugin file, update it with this new code. If not, create a new file named
-
Update the API Key:
- Replace
YOUR_YOUTUBE_API_KEY
with your actual YouTube Data API key.
- Replace
-
Upload the Plugin:
- Follow the previous instructions to upload and activate the plugin.
-
Use the Shortcode:
- Add the shortcodes as mentioned above to any post or page to display the latest videos from different YouTube channels.
This setup will allow you to easily showcase videos from multiple channels on your WordPress site. Let me know if you need further assistance!
- Dynamic Channel ID: The
To Help with API pulls.
Create a Custom Table for News Storage
Fetch News from NewsAPI and Store Locally
Display the Cached Data on the Frontend
Key Features:
- Database Caching: News is cached in the database for 12 hours to avoid repeated API calls.
- Search & Radio Buttons: Users can search news by typing a query or selecting default categories like "Israel," "Russia," or "Iran" with the radio buttons.
- Custom Table: A custom table is created in the WordPress database to store the news articles.
- Shortcode: The
world_news
shortcode can be used on any page or post to display the news.
Changes Made:
- Database Caching: Added a database caching mechanism that stores the video data for 12 hours. The table
youtube_video_cache
is created to hold the channel ID, video data, and timestamp. - Columns Parameter: Added a
columns
attribute to the shortcode to specify how many videos to display per row. This is now controlled via CSS grid. - Dynamic CSS for Grid Layout: The output is structured to create a CSS grid layout based on the specified number of columns.
Usage
To use the shortcode, you can specify the channel ID and the number of columns like this:
vcf_latest_videos channel_id="YOUR_CHANNEL_ID" columns="3"
Replace "YOUR_CHANNEL_ID"
with the actual channel ID you want to fetch videos from. This will display the videos
Key Changes:
- Flexbox Layout: The
.video
class is set todisplay: flex
andflex-direction: column
, ensuring that all child elements (iframe, title, description, and button) are stacked vertically and spaced evenly. - Height Adjustment: The
.video
class hasheight: 100%
, ensuring each video item has the same height, which keeps them aligned properly in the grid. - Centered Text: The title, description, and button are center-aligned to create a more balanced look.
- Published Date: The code fetches the published date from the YouTube API (
publishedAt
) and formats it using PHP'sdate()
function. - Display Date: The formatted date is displayed in the video output as a new paragraph with the class
video-date
. - Time Ago Calculation: The
human_time_diff()
function calculates how long ago the video was published based on the timestamp. This is then formatted as a string indicating how long ago the video was released (e.g., "3 days ago"). - Display: The formatted date and the time ago string are displayed together in the output
Latest Post: projectM-visualizer Our newest member: Joe Quintero Recent Posts Unread Posts Tags
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed