}
function addMetaTagFORSEO()
{
global $post;
if (is_home()) {
$title = get_bloginfo("name");
if (get_query_var("paged")) {
$paged = get_query_var("paged");
} else {
if (get_query_var("page")) {
$paged = get_query_var("page");
} else {
$paged = 1;
}
}
if (1 < $paged) {
$title .= " - صفحة " . $paged;
}
$description = (get_option("SiteName") == "") ? get_bloginfo("description") : get_option("descSite");
$canonical = home_url();
$sitename = get_option("SiteName") != "" ? get_option("SiteName") : get_bloginfo("name");
echo "
" . $sitename . "
";
}
elseif(is_tax() || is_tag() || is_category())
{
$obj = get_queried_object();
$sitename = get_option("SiteName") == "" ? get_bloginfo("name") : get_option("SiteName");
$secondname = get_bloginfo("name");
$title = $obj->name . " - " . $sitename;
if (get_query_var("paged")) {
$paged = get_query_var("paged");
} else {
if (get_query_var("page")) {
$paged = get_query_var("page");
} else {
$paged = 1;
}
}
if (1 < $paged) {
$title .= " - صفحة " . $paged;
}
$description = $obj->description;
$canonical = get_term_link($obj);
echo "
" . $title . "
";
}
elseif(is_search())
{
if (get_query_var("paged")) {
$paged = get_query_var("paged");
} else {
if (get_query_var("page")) {
$paged = get_query_var("page");
} else {
$paged = 1;
}
}
if (1 < $paged) {
$title .= " - صفحة " . $paged;
}
$description = get_option("descSite") == "" ? get_bloginfo("descSite") : get_option("description");
$canonical = home_url();
$sitename = get_option("SiteName") == "" ? get_bloginfo("name") : get_option("SiteName");
$title = "نتائج البحث عن " . get_search_query() . " | " . $sitename;
echo "
" . $title . "
";
}
elseif (is_singular())
{
$post = get_queried_object();
$sitename = get_option("SiteName") == "" ? get_bloginfo("name") : get_option("SiteName");
$facebook = get_option("facebook");
$title = $post->post_title;
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
$ogimage = !isset(get_post_meta($post->ID, "ogimage", true)["url"]) && empty(get_post_meta($post->ID, "ogimage", true)["url"]) ? $image : get_post_meta($post->ID, "ogimage", true)["url"];
$content = $post->post_content;
$metadescription = get_post_meta($post->ID, "metadescription", true) == "" ? $content : get_post_meta($post->ID, "metadescription", true);
$metadescription = wp_trim_words($metadescription, 30, "");
$metatitle = get_post_meta($post->ID, "metatitle", true) == "" ? $title : get_post_meta($post->ID, "metatitle", true);
if (get_query_var("download")) {
$metatitle .= " - تحميل";
}
$canonical = GetCanonicalURL();
if ($post->post_type == "post") {
$cats = is_array(get_the_terms($post->ID, "category", "")) ? get_the_terms($post->ID, "category", "") : array();
}
$category = "";
foreach (array_slice($cats, 0, 1) as $term) {
$category = $term->name;
}
$publishedtime = date("c", strtotime($post->post_date));
$modifiedtime = date("c", strtotime($post->post_modified));
$metatitle = (get_page_template_slug( $post->ID ) == "page-home.php") ? $title : $title . " | " . $sitename;
echo "
" . $metatitle . "
";
}
else
{
?>
}
}
function GetCanonicalURL()
{
$pageURL = "http";
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
return $pageURL;
}
add_action( "wp_head", "addMetaTagFORSEO" );
function addSchema($post)
{
global $post;
$seriesTax = "series";
if (wp_get_attachment_url(get_post_thumbnail_id($post->ID))) {
$thumb = get_the_post_thumbnail_url($post->ID, "TopSlider ");
} else {
$thumb = get_option("DefultBlock")["url"];
}
$Schema = "movie";
foreach (is_array(get_the_terms($post->ID, $seriesTax, "")) ? get_the_terms($post->ID, $seriesTax, "") : array() as $series) {
$Schema = "serie";
if (0 < $series->parent) {
$HasSeasons = true;
$SerieID = $series->parent;
$CurrentSeason = $series->term_id;
} else {
$CurrentSeries = $series->term_id;
}
}
foreach (is_array(get_the_terms($post->ID, "tvshow", "")) ? get_the_terms($post->ID, "tvshow", "") : array() as $tvshow) {
$Schema = "tvshow";
if (0 < $tvshow->parent) {
$HasSeasons = true;
$tvshowID = $tvshow->parent;
$CurrentSeTv = $tvshow->term_id;
} else {
if (isset($serie->parent) && $serie->parent == 0) {
$CurrentTvShow = $tvshow->term_id;
} else {
$CurrentTvShow = $tvshow->term_id;
}
}
}
if ($Schema == "movie") {
echo "
";
echo "
" . get_the_title($post->ID) . "
";
echo "
ID)) . "\" itemprop=\"image\" />";
echo "
" . wp_trim_words(get_the_content(), 20, "...") . "";
echo "Director:";
foreach (is_array(get_the_terms($post->ID, "director", "")) ? get_the_terms($post->ID, "director", "") : array() as $director) {
echo "
";
echo "" . $director->name . "";
echo "
";
}
echo "Writers:";
foreach (is_array(get_the_terms($post->ID, "escritor", "")) ? get_the_terms($post->ID, "escritor", "") : array() as $writers) {
echo "
";
echo "" . $writers->name . "";
echo "
";
}
echo "Stars:";
foreach (is_array(get_the_terms($post->ID, "actor", "")) ? get_the_terms($post->ID, "actor", "") : array() as $actor) {
echo "
";
echo "" . $actor->name . ",";
echo "
";
}
echo "
8/10 stars from200 users.Reviews: 50.
";
echo "
post_date)) . "\" class=\"runtime\">";
echo date("d-m-Y", strtotime($post->post_date));
echo "";
} else {
if ($Schema == "tvshow") {
if (get_the_terms($post->ID, "tvshow", "")) {
foreach (get_the_terms($post->ID, "tvshow", "") as $serie) {
if ($serie->parent == 0) {
echo "
";
echo "
";
echo "" . $serie->name . ",";
foreach (get_the_terms($post->ID, "tvshow", "") as $season) {
if (0 < $season->parent) {
echo "
";
}
}
echo "
";
}
}
}
} else {
if ($Schema == "serie" || get_the_terms($post->ID, $seriesTax, "")) {
foreach (get_the_terms($post->ID, $seriesTax, "") as $serie) {
if ($serie->parent == 0) {
echo "
";
echo "
";
echo "" . $serie->name . ",";
foreach (get_the_terms($post->ID, $seriesTax, "") as $season) {
if (0 < $season->parent) {
echo "
";
}
}
echo "
";
}
}
}
}
}
echo "
";
echo "ID) . "\">";
echo "ID)) . "\">";
echo "ID) . "\">";
echo "post_date)) . "T04:56:26\">";
echo "ID) . "?watch=1\">";
echo "";
}
Parse error: Unclosed '{' on line 5 in
/var/www/vhosts/cima4u.org/domains/c4u.top/public_html/wp-content/themes/c4u/Standard/Functions/Seo.php on line
335