{"id":4234,"date":"2023-11-03T01:30:42","date_gmt":"2023-11-03T00:30:42","guid":{"rendered":"https:\/\/tulipemedia.com\/?p=4234"},"modified":"2025-05-15T17:59:43","modified_gmt":"2025-05-15T15:59:43","slug":"%d8%b7%d9%88%d9%84-%d8%a7%d8%b3%d8%aa%d8%ae%d8%b1%d8%a7%d8%ac-%d9%85%d9%82%d8%aa%d8%b7%d9%81%d8%a7%d8%aa-%d9%88%d8%b8%d9%8a%d9%81%d8%a9-%d9%88%d9%88%d8%b1%d8%af%d8%a8%d8%b1%d9%8a%d8%b3-%d9%83%d9%88","status":"publish","type":"post","link":"https:\/\/tulipemedia.com\/ar\/longueur-extrait-excerpt-wordpress-fonction-code-php\/","title":{"rendered":"\u0642\u0645 \u0628\u062a\u063a\u064a\u064a\u0631 \u0637\u0648\u0644 \u0627\u0644\u0645\u0642\u062a\u0637\u0641 \u0627\u0644\u0627\u0641\u062a\u0631\u0627\u0636\u064a \u0641\u064a WordPress"},"content":{"rendered":"<p>\u0645\u0642\u062a\u0637\u0641 WordPress \u0639\u0628\u0631 \u0648\u0638\u064a\u0641\u0629 the_excerpt() \u0647\u0648 \u0645\u0644\u062e\u0635 \u0645\u062e\u062a\u0635\u0631 \u0644\u0645\u0646\u0634\u0648\u0631 \u0645\u0646 \u0645\u062f\u0648\u0646\u0629 WordPress \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0643 \u0648\u0627\u0644\u0630\u064a \u064a\u0638\u0647\u0631 \u062d\u064a\u062b \u064a\u062a\u0645 \u0627\u0633\u062a\u062f\u0639\u0627\u0624\u0647\u060c \u0639\u0627\u062f\u0629\u064b \u0639\u0644\u0649 \u0635\u0641\u062d\u0627\u062a \u0627\u0644\u0623\u0631\u0634\u064a\u0641 (\u0627\u0644\u0641\u0626\u0627\u062a\u060c \u0627\u0644\u0639\u0644\u0627\u0645\u0627\u062a\u060c \u0635\u0641\u062d\u0627\u062a \u0627\u0644\u0645\u0624\u0644\u0641)\u060c \u0646\u062a\u0627\u0626\u062c \u0627\u0644\u0628\u062d\u062b\u060c \u0648\u0641\u064a \u0628\u0639\u0636 \u0627\u0644\u062d\u0627\u0644\u0627\u062a\u060c \u0639\u0644\u0649 \u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629 \u0635\u0641\u062d\u0629 \u0645\u0648\u0642\u0639\u0643\u060c \u0648\u0644\u0643\u0646 \u0623\u064a\u0636\u064b\u0627 \u0641\u064a \u0645\u0648\u062c\u0632 RSS \u0648\u0641\u064a \u0645\u0627 \u064a\u062a\u0645 \u0625\u0631\u0633\u0627\u0644\u0647 \u0623\u062d\u064a\u0627\u0646\u064b\u0627 \u0625\u0644\u0649 \u0627\u0644\u0634\u0628\u0643\u0627\u062a \u0627\u0644\u0627\u062c\u062a\u0645\u0627\u0639\u064a\u0629 \u0639\u0628\u0631 \u0645\u0644\u062d\u0642\u0627\u062a \u0645\u062d\u062f\u062f\u0629.<\/p>\n<p>\u0627\u0641\u062a\u0631\u0627\u0636\u064a\u064b\u0627\u060c \u064a\u0633\u062a\u062e\u062f\u0645 WordPress 55 \u0643\u0644\u0645\u0629 \u0643\u062d\u062f \u0623\u0642\u0635\u0649 \u0644\u0637\u0648\u0644 \u0627\u0644\u0645\u0642\u062a\u0637\u0641. \u064a\u0631\u062c\u0649 \u0645\u0644\u0627\u062d\u0638\u0629 \u0623\u0646 \u0628\u0639\u0636 \u0627\u0644\u0633\u0645\u0627\u062a \u062a\u0633\u0645\u062d \u0644\u0643 \u0628\u062a\u0639\u0631\u064a\u0641 \u0647\u0630\u0627 \u0627\u0644\u0645\u0633\u062a\u062e\u0631\u062c \u0639\u0628\u0631 \u0648\u0638\u064a\u0641\u0629 &quot;\u0627\u0644\u062a\u062e\u0635\u064a\u0635&quot;\u060c \u0644\u0643\u0646 \u0627\u0644\u0628\u0639\u0636 \u0627\u0644\u0622\u062e\u0631 \u0644\u0627 \u064a\u0633\u0645\u062d \u0628\u0630\u0644\u0643 \u0648\u0641\u064a \u0628\u0639\u0636 \u0627\u0644\u0623\u062d\u064a\u0627\u0646 \u0644\u0627 \u062a\u0632\u0627\u0644 \u0628\u062d\u0627\u062c\u0629 \u0625\u0644\u0649 \u062a\u062e\u0635\u064a\u0635 \u0630\u0644\u0643 \u0639\u0628\u0631 \u062c\u0632\u0621 \u0645\u0646 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629.<\/p>\n<h2>\u0648\u0638\u064a\u0641\u0629 \u0644\u062a\u062e\u0635\u064a\u0635 \u0637\u0648\u0644 \u0627\u0644\u0645\u0642\u062a\u0637\u0641 \u0645\u0646 \u062e\u0644\u0627\u0644 \u0639\u062f\u062f \u0627\u0644\u0643\u0644\u0645\u0627\u062a<\/h2>\n<p>\u0644\u0632\u064a\u0627\u062f\u0629 \u062d\u062c\u0645 \u0647\u0630\u0627 \u0627\u0644\u0645\u0633\u062a\u062e\u0631\u062c \u0623\u0648 \u062a\u0642\u0644\u064a\u0644\u0647\u060c \u0625\u0644\u064a\u0643 \u0637\u0631\u064a\u0642\u0629 \u0628\u0633\u064a\u0637\u0629 \u0644\u0625\u0636\u0627\u0641\u062a\u0647\u0627 \u0625\u0644\u0649 \u0645\u0644\u0641 function.php \u0627\u0644\u062e\u0627\u0635 \u0628\u0645\u0648\u0636\u0648\u0639\u0643\u060c \u0623\u0648 \u0639\u0628\u0631 \u0645\u0643\u0648\u0646 \u0625\u0636\u0627\u0641\u064a \u0645\u062b\u0644 <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" target=\"_blank\" rel=\"noopener\">\u0645\u0642\u062a\u0637\u0641\u0627\u062a \u0627\u0644\u0634\u0641\u0631\u0629<\/a>.<\/p>\n<p><em>\u0648\u0638\u064a\u0641\u0629 custom_excerpt_length($length) {<\/em><br \/>\n<em>\u0627\u0644\u0639\u0648\u062f\u0629 100\u061b \/\/ \u0642\u0645 \u0628\u062a\u063a\u064a\u064a\u0631 \u0647\u0630\u0627 \u0627\u0644\u0631\u0642\u0645 \u0625\u0644\u0649 \u0637\u0648\u0644 \u0627\u0644\u0627\u0633\u062a\u062b\u0646\u0627\u0621 \u0627\u0644\u0645\u0637\u0644\u0648\u0628<\/em><br \/>\n<em>}<\/em><br \/>\n<em>add_filter(&#039;excerpt_length&#039;, &#039;custom_excerpt_length&#039;, 999);<\/em><\/p>\n<p>\u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0645\u0642\u062a\u0637\u0641 \u0646\u062d\u062f\u062f \u0648\u0638\u064a\u0641\u0629 \u062c\u062f\u064a\u062f\u0629 \u062a\u0633\u0645\u0649 &quot;custom_excerpt_length&quot; \u0648\u0627\u0644\u062a\u064a \u062a\u0633\u062a\u062f\u0639\u064a \u0648\u0638\u064a\u0641\u0629 \u0637\u0648\u0644 WordPress\u060c \u0648\u0627\u0644\u062a\u064a \u062a\u062d\u062f\u062f \u0637\u0648\u0644 \u0645\u0642\u062a\u0637\u0641 \u0645\u0646 \u0645\u0646\u0634\u0648\u0631 \u0623\u0648 \u0635\u0641\u062d\u0629 WordPress\u060c \u0648\u0627\u0644\u062a\u064a \u0642\u0645\u0646\u0627 \u0628\u0636\u0628\u0637\u0647\u0627 \u0639\u0644\u0649 &quot;100&quot; \u0643\u0644\u0645\u0629 \u0639\u0644\u0649 \u0633\u0628\u064a\u0644 \u0627\u0644\u0645\u062b\u0627\u0644\u060c \u0639\u0628\u0631 \u062a\u0639\u0644\u064a\u0645\u0627\u062a &quot;return&quot; \u060c \u0648\u0628\u0639\u062f \u0630\u0644\u0643 \u0646\u0636\u064a\u0641 \u0647\u0630\u0627 \u0627\u0644\u0641\u0644\u062a\u0631 \u0627\u0644\u062c\u062f\u064a\u062f \u0645\u0639 \u0627\u0644\u0645\u0639\u0644\u0645\u0629 999 \u0644\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0623\u0646\u0647 \u064a\u0623\u062a\u064a \u0628\u0639\u062f \u0623\u064a \u0645\u0631\u0634\u062d \u0622\u062e\u0631 \u0645\u062d\u062a\u0645\u0644 \u064a\u062d\u062a\u0648\u064a \u0639\u0644\u0649 \u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0645\u062a\u0646\u0627\u0642\u0636\u0629 \u0628\u0634\u0623\u0646 \u0648\u0638\u064a\u0641\u0629 &quot;\u0627\u0644\u0637\u0648\u0644&quot; \u0644\u0644\u0645\u0633\u062a\u062e\u0644\u0635.<\/p>\n<p>\u0644\u0643\u0646 \u0643\u0646 \u062d\u0630\u0631\u064b\u0627\u060c \u0644\u0643\u064a \u064a\u062a\u0645 \u0623\u062e\u0630 \u0630\u0644\u0643 \u0641\u064a \u0627\u0644\u0627\u0639\u062a\u0628\u0627\u0631 \u0645\u0646 \u062c\u0627\u0646\u0628 \u0627\u0644\u0633\u0645\u0629\u060c \u062a\u0623\u0643\u062f \u0645\u0646 \u0623\u0646 \u0627\u0644\u0633\u0645\u0629 \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0643 \u062a\u0633\u062a\u062f\u0639\u064a \u0627\u0644\u0648\u0638\u064a\u0641\u0629 <em>\u0627\u0633\u062a\u062b\u0646\u0627\u0621<\/em> \u0641\u064a \u0645\u0643\u0627\u0646 \u0645\u0627 \u062a\u0631\u064a\u062f \u0623\u0646 \u064a\u0638\u0647\u0631 \u0641\u064a\u0647 \u0645\u0642\u062a\u0637\u0641 \u0627\u0644\u0645\u0642\u0627\u0644\u0629 \u0641\u064a \u062d\u0644\u0642\u062a\u0643\u060c \u0639\u0628\u0631 \u0627\u0644\u0643\u0648\u062f <em>&lt;?php echo get_excerpt(); ?&gt;<\/em><\/p>\n<p>\u0647\u0646\u0627\u0643 \u0623\u064a\u0636\u064b\u0627 \u0637\u0631\u064a\u0642\u0629 \u0623\u062e\u0631\u0649 \u0644\u062a\u062e\u0635\u064a\u0635 \u0637\u0648\u0644 \u0645\u0642\u062a\u0637\u0641 \u0645\u0646\u0634\u0648\u0631 WordPress\u060c \u0648\u0627\u0644\u0630\u064a \u064a\u0639\u062a\u0645\u062f \u0639\u0644\u0649 \u0639\u062f\u062f \u0627\u0644\u0641\u0642\u0631\u0627\u062a.<\/p>\n<h2>\u0648\u0638\u064a\u0641\u0629 \u0644\u062a\u062e\u0635\u064a\u0635 \u0637\u0648\u0644 \u0627\u0644\u0645\u0642\u062a\u0637\u0641 \u0639\u0628\u0631 \u0639\u062f\u062f \u0627\u0644\u0641\u0642\u0631\u0627\u062a<\/h2>\n<p>\u062a\u0639\u062a\u0628\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u064a\u0632\u0629 \u0645\u0641\u064a\u062f\u0629 \u0628\u0634\u0643\u0644 \u062e\u0627\u0635 \u0625\u0630\u0627 \u0643\u0646\u062a \u062a\u0631\u064a\u062f \u062a\u062c\u0646\u0628 \u0642\u0637\u0639 \u0627\u0644\u062c\u0645\u0644\u0629 \u0641\u064a \u0627\u0644\u0645\u0646\u062a\u0635\u0641. \u0644\u0644\u0642\u064a\u0627\u0645 \u0628\u0630\u0644\u0643\u060c \u0627\u0646\u0633\u062e \u0647\u0630\u0627 \u0627\u0644\u062c\u0632\u0621 \u0645\u0646 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0648\u0627\u0644\u0635\u0642\u0647 \u0641\u064a \u0645\u0644\u0641 &quot;functions.php&quot; \u0627\u0644\u062e\u0627\u0635 \u0628\u0643\u060c \u0623\u0648 \u0639\u0628\u0631 \u0645\u0644\u062d\u0642 Code Snippets \u0623\u0648 \u0623\u064a \u0645\u0643\u0648\u0646 \u0625\u0636\u0627\u0641\u064a \u0622\u062e\u0631 \u064a\u0633\u0645\u062d \u0628\u0625\u0636\u0627\u0641\u0629 \u0648\u0638\u0627\u0626\u0641 PHP \u0625\u0644\u0649 \u062a\u062b\u0628\u064a\u062a WordPress \u0627\u0644\u062e\u0627\u0635 \u0628\u0643:<\/p>\n<p><em><span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token string single-quoted-string\">&quot;wp_trim_excerpt&quot;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string single-quoted-string\">&quot;\u0627\u0633\u062a\u062b\u0646\u0627\u0621_\u0645\u062e\u0635\u0635&quot;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">2<\/span> <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<br \/>\n<\/span><span class=\"token keyword\">\u0648\u0638\u064a\u0641\u0629<\/span> <span class=\"token function-definition function\">my_custom_exception<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$text<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token variable\">$raw_excerpt<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<br \/>\n<\/span><span class=\"token keyword\">\u0644\u0648<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token operator\">!<\/span> <span class=\"token variable\">$raw_excerpt<\/span> <span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<br \/>\n<\/span><span class=\"token variable\">\u0645\u062d\u062a\u0648\u0649 $<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">Apply_filters<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token string single-quoted-string\">&#039;\u0627\u0644\u0645\u062d\u062a\u0648\u0649&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token function\">get_the_content<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<br \/>\n<\/span><span class=\"token variable\">$text<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">\u0627\u0633\u0645<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token variable\">\u0645\u062d\u062a\u0648\u0649 $<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token function\">com.strpos<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token variable\">\u0645\u062d\u062a\u0648\u0649 $<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string single-quoted-string\">&amp;#039;&lt;\/p&gt;&amp;#039;<\/span> <span class=\"token punctuation\">)<\/span> <span class=\"token operator\">+<\/span> <span class=\"token number\">4<\/span> <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<br \/>\n<\/span><span class=\"token punctuation\">}<br \/>\n<\/span><span class=\"token keyword\">\u064a\u0639\u0648\u062f<\/span> <span class=\"token variable\">$text<\/span><span class=\"token punctuation\">;<\/span><\/em><\/p>\n<p>\u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0648\u0638\u064a\u0641\u0629 wp_trim_excerpt\u060c \u064a\u062a\u062c\u0627\u0648\u0632 WordPress \u0637\u0648\u0644 \u0627\u0644\u0645\u0642\u062a\u0637\u0641 \u0645\u0646 \u062d\u064a\u062b \u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0623\u0648 \u0627\u0644\u0623\u062d\u0631\u0641 \u0648\u064a\u0639\u062a\u0628\u0631 \u0627\u0644\u0641\u0642\u0631\u0629 \u0627\u0644\u0623\u0648\u0644\u0649 \u0647\u064a \u0627\u0644\u0645\u0642\u062a\u0637\u0641\u060c \u0628\u0644 \u0625\u0646\u0647 \u064a\u0639\u0645\u0644 \u0645\u0639 Elementor.<\/p>","protected":false},"excerpt":{"rendered":"<p>L&rsquo;extrait WordPress via la fonction the_excerpt() est un bref r\u00e9sum\u00e9 d&rsquo;une publication de votre blog WordPress qui appara\u00eet l\u00e0 o\u00f9 elle est appel\u00e9e, g\u00e9n\u00e9ralement sur les pages d&rsquo;archives (cat\u00e9gories, tag, pages d&rsquo;auteur), les r\u00e9sultats de recherche et, dans certains cas, sur la page d&rsquo;accueil de votre site, mais aussi dans le flux RSS et dans [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":1033,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[164],"class_list":["post-4234","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","tag-tips-wordpress"],"_links":{"self":[{"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/posts\/4234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/comments?post=4234"}],"version-history":[{"count":2,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/posts\/4234\/revisions"}],"predecessor-version":[{"id":4255,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/posts\/4234\/revisions\/4255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/media\/1033"}],"wp:attachment":[{"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/media?parent=4234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/categories?post=4234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tulipemedia.com\/ar\/wp-json\/wp\/v2\/tags?post=4234"}],"curies":[{"name":"\u0648\u0648\u0631\u062f\u0628\u0631\u064a\u0633","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}