{"id":16559602,"date":"2023-03-14T19:21:01","date_gmt":"2023-03-14T19:21:01","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/custom-layout-function-help\/"},"modified":"2023-03-14T19:21:01","modified_gmt":"2023-03-14T19:21:01","slug":"custom-layout-function-help","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/custom-layout-function-help\/","title":{"rendered":"Custom Layout Function Help"},"content":{"rendered":"<p>This is the code I have in my theme&#8217;s functions.php<\/p>\n<pre><code>function func_custom_layout($layout, $post_id, $filter_id, $increment_post) {  \n\t   $layout  = &#039;&lt;h2&gt;&#039;.get_the_title($post_id).&#039;&lt;\/h2&gt;&#039;;\n\t   $layout .= &#039;&lt;p&gt;&#039;.wp_trim_words(get_the_content($post_id), 30).&#039;&lt;\/p&gt;&#039;;\n\t   $layout .= &#039;&lt;a href=&quot;&#039;.get_the_permalink($post_id).&#039;&quot;&gt;Read More&lt;\/a&gt;&#039;;   \n\t   return $layout;\n\t}\n\tadd_filter(&quot;ymc_post_custom_layout_545_ID&quot;, &quot;func_custom_layout&quot;, 10, 5);<\/code><\/pre>\n<p>But as you can see at the supplied link, it doesn&#8217;t seem to be working. Any help would be great. Thanks<\/p>\n","protected":false},"template":"","class_list":["post-16559602","topic","type-topic","status-publish","hentry","topic-tag-function","topic-tag-layout"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16559602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16559602\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16559602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}