Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="refresh" content="5; url=<?php echo $url; ?>">
<meta name="robots" content="noindex">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
/*
Template Name: Redirect Page
*/
$url = $_GET['url'];
include 'header2.php';
?>
<div class="content">
<?php if ( have_posts() ) : ?>
/*
* Add Missing Alt Tags To WordPress Images : paulund.co.uk
*/
function add_alt_tags($content){
global $post;
preg_match_all('/&lt;img (.*?)\/&gt;/', $content, $images);
if(!is_null($images)){
foreach($images[1] as $index =&gt; $value) {
if(!preg_match('/alt=/', $value)) {
$new_img = str_replace('&lt;img', '&lt;img alt=&quot;'.$post-&gt;post_title.'&quot;', $images[0][$index]);
/*
* Add Missing Alt Tags To WordPress Images : advanced
* source : https://www.mwordpress.net/repair-alternative-alt-text-for-wordpress-images/
* Mwordpress.net - مجلة ووردبريس
*/
function fill_alt_tags($content){
global $post;
preg_match_all('/<img (.*?)\/>/', $content, $images);
/*
* Function Description : Facebook Scrape
* Author Name : Mouad Achemli
* Source : https://www.mwordpress.net/force-facebook-to-update-post-thumbnail-automatically/
* Inspered from : https://stackoverflow.com/a/32916433/2535061
* @website : https://www.mwordpress.net/
*
*/
function scrape_open_graph($post) {
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<link rel="image_src" href="رابط الصورة" />
<meta property="og:image" content="رابط الصورة" />
/*
* get content and clean
*/
function mwp_post_content($post_id) {
$post = get_post($post_id);
$output = $post->post_content;
$replace = "@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@";
$output = wp_strip_all_tags($output, true);
$output = strip_shortcodes($output);
$output = ltrim($output);
/*
تنسيقات الهاك
يحب عليك تعديلها على حسب الشكل الذي تريد عررض المواضيع بها
*/
.custom-related {
margin:0;
padding:2%;
width:96%;
}
.custom-related h2{