{"id":6443,"date":"2014-04-18T05:23:04","date_gmt":"2014-04-18T05:23:04","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/custom-post-typespostsphptheme-developmentpost-metarelated-issues-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:47:13","modified_gmt":"2022-08-30T15:47:13","slug":"custom-post-typespostsphptheme-developmentpost-metarelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/custom-post-typespostsphptheme-developmentpost-metarelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"custom-post-types,posts,php,theme-development,post-metaRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/07982d6dd5227400863834231aa0e390?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkaiser<br \/>\ncustom-post-types search<br \/>\nThe default WordPress search setup isn&#8217;t really working for my website&#8217;s setup.I have two custom post types (species, glossary) which I&#8217;d like to search for, as well as the standard post type.The species post type (which I&#8217;ll refer to herein as species profiles) is made up of a number of meta fields, including genus and species (two taxonomic ranks which are used to commonly identify species of fish). The title of a species profile is its scientific name (Genus species) and any non-scientific co<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e4dc1a0cdc6ed4a35d96fd349b444efc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsico87<br \/>\ncustom-post-types posts template-tags read-more<br \/>\nI have a custom post type called &#8220;Blog&#8221;, in my templates I looping over the blog type and doing the following, &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;&lt;section class=&#8221;news&#8221;&gt;&lt;h2 class=&#8221;title&#8221;&gt;&lt;?php echo strtolower(the_title()); ?&gt;&lt;\/h2&gt;&lt;h4&gt;&lt;?php userphoto_the_author_thumbnail();?&gt; Posted By &lt;?php the_author(); ?&gt; &#8211; &lt;?php the_date(&#8220;l jS M Y&#8221;); ?&gt;&lt;\/h4&gt;&lt;p class=&#8221;tags&#8221;&gt;&lt;?php $tags = wp_get_post_tags($post-&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8aa88317f7f5c0f03f87a41242f1a595?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntoomanyairmiles<br \/>\ncustom-post-types categories pagination 404-error<br \/>\nI&#8217;ve recently created several custom post types in a wordpress site, with the code below, they are generating links in the correct form e.g. root\/category\/id\/postname but each link to the full post, pagination or category 404&#8217;s. I&#8217;ve tried a number of popular solutions, appending \/%category%\/%post_id%\/ to the url structure, rewriting function names but I&#8217;m getting nowhere fast.With the wordpress permalink structure set to default e.g. root\/?page_id=1257 everything works ok. Any effort to add add<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/07982d6dd5227400863834231aa0e390?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkaiser<br \/>\ncustom-post-types wp-query meta-query<br \/>\nI would like to use a meta_key to store multiple values in that key. Thereafter, I would like to filter away posts that do not contain a specific value in the key. In other words, just show posts that do not contain a specific value. This, however, does not seem to be possible. I am writing this question here to see if anyone has come to the same conclusion or if I am just missing something. Here is the code I have used:\/\/ The values in key &#8220;_no_interest&#8221; are: 1,2,3 add_action( &#8216;pre_get_posts<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fee8e31e1543e0fd98fe80cf719f879f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMayeenul Islam<br \/>\ncustom-post-types post-meta order custom-post-type-archives<br \/>\nI am building a movie archive. For each movie I am filling out the release dates for 3 countries, they&#8217;re stored as custom fields (added via Pods)Now, when listing the movies I would like to build an array and loop through each post to check if the fields have values, then compare the values and sort by the first date (oldest or least recent date). If none of the fields have values the posted date should be used for sorting. I am already sorting posts of some categories and their child categorie<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/99f0d0a6e28b060cc39682f5bdbbdecb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDerk-Jan<br \/>\ncustom-post-types categories custom-taxonomy<br \/>\nHow can I query all the posts from either the custom post type (&#8216;videos&#8217;) or with a post category (&#8216;video&#8217;) in a loop?I&#8217;ve managed to create a query that combines the posts from a custom post type and the normal posts using the code below, but am struggling with achieving the same with a custom post type and a post category.&lt;?php $args = array_merge( $wp_query-&gt;query, array( &#8216;post_type&#8217; =&gt; array( &#8216;post&#8217;, &#8216;videos&#8217;, ) ) ); query_posts( $args ); ?&gt; &lt;?php if ( have_posts() ) : wh<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c1883fc0f64da3a54e7eaa7e9ab0d725?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChris_O<br \/>\ncustom-post-types custom-taxonomy loop<br \/>\nI am creating a WordPress theme for a record label. One aspect is the video gallery. I created the gallery using a custom post type called &#8216;videos&#8217;. The code below is what I placed in my functions.php file to set up the post type:add_action( &#8216;init&#8217;, &#8216;create_my_post_types&#8217; );function create_my_post_types() {register_post_type( &#8216;videos&#8217;,array(&#8216;labels&#8217; =&gt; array(&#8216;name&#8217; =&gt; __( &#8216;Videos&#8217; ),&#8217;singular_name&#8217; =&gt; __( &#8216;Video&#8217; ),&#8217;add_new&#8217; =&gt; &#8216;Add New Video&#8217;,&#8217;edit&#8217; =&gt; &#8216;Edit Video&#8217;),&#8217;public&#8217; =&gt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/97c17d2586ffc4e174040f451d1b5101?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChris<br \/>\ncustom-post-types excerpt<br \/>\nThis is proving to be a challenge.I&#8217;m trying to make the excerpt a required field, but only when editing\/saving a post in a custom post type.The following code makes the excerpt a required field for all posts, but doesn&#8217;t take into account for narrowing its affect to a single custom post type.function mandatory_excerpt($data) {$excerpt = $data[&#8216;post_excerpt&#8217;];if (empty($excerpt)) {if ($data[&#8216;post_status&#8217;] === &#8216;publish&#8217;) {add_filter(&#8216;redirect_post_location&#8217;, &#8216;excerpt_error_message_redirect&#8217;, &#8217;99&#8217;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5bf957a9f803c940a9494823b476fa99?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ns_ha_dum<br \/>\ncustom-post-types custom-field<br \/>\nI am trying to order a custom post type called &#8220;Teachers&#8221; by a field called sort_by. I am not sure why this isn&#8217;t working. Here is my code:$args = array( &#8216;post_type&#8217; =&gt; &#8216;teacher&#8217;, &#8216;posts_per_page&#8217; =&gt; 30, &#8216;order_by&#8217; =&gt; &#8216;sort_by&#8217; ,&#8217;order&#8217;=&gt;&#8217;ASC&#8217; ); $loop = new WP_Query( $args ); while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post();echo &#8216;&lt;div class=&#8221;entry-content&#8221;&gt;&lt;h2 class=&#8221;teachers&#8221;&gt;&#8217;;the_title();echo &#8216;&lt;\/h2&gt;&#8217;;the_excerpt();echo &#8216;&lt;\/div&gt;&#8217;; endwhile;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5aa9fc6ba476bd581c96ab47be705d74?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKrzysiek Dr\u00f3zdz<br \/>\ncustom-post-types wp-query loop<br \/>\nI am currently using WP_Query to loop through a custom post type, and only showing the parent posts like so:&lt;?php$loop = new WP_Query( array(&#8216;post_type&#8217; =&gt; &#8216;programs&#8217;,&#8217;posts_per_page&#8217; =&gt; -1,&#8217;post_parent&#8217; =&gt; 0) ); ?&gt; &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); ?&gt;loop stuff&lt;?php endwhile; ?&gt;Within each loop, I need to to do another loop, which shows all of the children of that post that is currently being iterated on. The point is to show each post, an<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/318b053265920e311709b198729d6112?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndrtanz<br \/>\nposts cron<br \/>\nhow can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts?The reason is that these posts are being imported automatically periodically, so I want to prevent the DB getting too large, apart from the fact that the older posts won&#8217;t be needed.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e4dc1a0cdc6ed4a35d96fd349b444efc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsico87<br \/>\ncustom-post-types posts template-tags read-more<br \/>\nI have a custom post type called &#8220;Blog&#8221;, in my templates I looping over the blog type and doing the following, &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;&lt;section class=&#8221;news&#8221;&gt;&lt;h2 class=&#8221;title&#8221;&gt;&lt;?php echo strtolower(the_title()); ?&gt;&lt;\/h2&gt;&lt;h4&gt;&lt;?php userphoto_the_author_thumbnail();?&gt; Posted By &lt;?php the_author(); ?&gt; &#8211; &lt;?php the_date(&#8220;l jS M Y&#8221;); ?&gt;&lt;\/h4&gt;&lt;p class=&#8221;tags&#8221;&gt;&lt;?php $tags = wp_get_post_tags($post-&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ea89afd6242491a6f37a3f769a67573d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nj-man86<br \/>\nphp wordpress count posts<br \/>\nI&#8217;m trying to use the following function from http:\/\/codex.wordpress.org\/Function_Reference\/count_user_postsfunction count_user_posts_by_type($userid, $post_type=&#8217;post&#8217;) {global $wpdb;$where = get_posts_by_author_sql($post_type, TRUE, $userid);$count = $wpdb-&gt;get_var( \\&#8221;SELECT COUNT(*) FROM $wpdb-&gt;posts $where\\&#8221; );return apply_filters(&#8216;get_usernumposts&#8217;, $count, $userid); }But I get the following error:Parse error: syntax error, unexpected &#8216;&#8221;&#8216;, expecting T_STRING in &#8230;\/wp-content\/themes\/a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/15ecafa9fc99e2d09ddd045fcce1bc63?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrett<br \/>\nwordpress plugins admin posts<br \/>\nMy wordpress admin is showing 0 posts, pages, categories, &amp; tags. However, everything is appearing on the frontend just fine. I&#8217;m running wordpress 3.0 and as far as I know no settings have been changed, plugins upgraded, etc since this began happening.Also, when searching for plugins I get the error &#8220;An Unexpected HTTP Error occurred during the API request.&#8221; I&#8217;m assuming this is related to the first problem, but it may not be.Thanks in advance for any help.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bcc776ba78d2ec0dfb5f56b3522afd63?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCiprian Popescu<br \/>\nposts merging<br \/>\nI need to be able to merge two or more posts. What is the exact query (or queries) to make this happen?The scenario is multiple recommendations that need to be merged into one. I have already sorted out comments merging and meta merging.Let&#8217;s say a user recommends Bill Gates, another one Gates Bill and another one makes a typo and adds Bil Gates. I need to merge these three posts and choose the destination one.UPDATE:What I need is a complete SQL query for deleting a post and all references to t<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/37bd4b8b3dd904fc302636e7bd4f9ee1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrian Fegter<br \/>\nposts functions<br \/>\nI added the following function to the file functions.phpfunction contentGenerator($param) {if($param) {echo &#8220;Content true&#8221;;} else {echo &#8220;Content false&#8221;;} }How can I call this function within a specific blog post or page?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/443b4786520b8cb14c7a3517355077d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMohammad Ali Akbari<br \/>\nposts attachments order<br \/>\nHere describes get_posts() function. I would like to know what types of order can I pass to get_posts?in WP admin, I can see menu order, title, date, random and &#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/31d3f9fac1a60a75898d90c440ab1d38?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNisha_at_Behance<br \/>\nposts plugin-contact-form-7<br \/>\nI am using nice SMCF (Contact Form) want to add a wordpress post list Drop Down menu in &#8220;Simple Model Contact form&#8221; here what i added on line &#8216;195&#8217; to try look.$output .= &#8220;&lt;div class=&#8217;colmsg&#8217;&gt;&lt;label for=&#8217;smcf-message&#8217;&gt;*&#8221; . __(&#8220;Message&#8221;, &#8220;smcf&#8221;) . &#8220;: &lt;\/label&gt;&lt;select name=&#8221;&#8221;&gt;&lt;option&gt;Post1&lt;\/option&gt;&lt;option&gt;Post2&lt;\/option&gt;&lt;option&gt;Post1&lt;\/option&gt;&lt;\/select&gt;&lt;\/div&gt;&lt;br\/&gt;&#8221;;after saving \/ uploading file, it showing Parse error: synt<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/005cc752f3e22ee027d3d1d71d240a1d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPat J<br \/>\ncustom-post-types posts loop shortcode<br \/>\nIs it possible to do a if statement in a do_shortcode?&lt;?php echo do_shortcode(&#8220;[table width=&#8217;500&#8242;] &#8221; . if ( have_posts() ) : while ( have_posts() ) : the_post(); the_content(); endwhile; endif; . &#8220;[\/table]&#8221;); ?&gt;It gives me an unexpected T_IF.EDIT: And without the IF statement it gives the post outside the shortcode.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/397a298d246dbea5eb04e9655233f4e1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhornj<br \/>\nposts sort<br \/>\nI&#8217;m trying to show the latest posts using the get_query_var function. The function filters the posts according to their category. When I&#8217;m displaying the posts on the page they appear unsorted although I&#8217;ve added the$paged = (get_query_var(&#8216;paged&#8217;)) ? get_query_var(&#8216;paged&#8217;) : 1;$args=array(&#8216;category__in&#8217;=&gt;array( $cat),&#8217;order&#8217; =&gt; ASC,&#8217;caller_get_posts&#8217; =&gt; 1,&#8217;paged&#8217;=&gt;$paged,&#8217;orderby&#8217; =&gt; date,);query_posts($args);How can I sort properly?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/7xvUe.jpg?s=32&amp;g=1\" \/><br \/>\nIain<br \/>\napache-2.2 php centos suphp<br \/>\nWe have a server that&#8217;s handling uploads. The memory limit is set at a ridiculously high level in php.ini (800 M).. however we have gd, which is managing the image resizing, but it is dying at about 60M of memory usage (our error log is reporting a fatal error at this stage).From all our Apache config files (CPanel\/WHM managed), I can&#8217;t find a RLimitMem that&#8217;s set anywhere either.I&#8217;ve looked as well if there&#8217;s any limits set in our kernel, but can&#8217;t find anything there as well.Is there somethin<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/563c72fef22f25de58e45db2b8c3a678?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHaresh Vidja<br \/>\nubuntu php wordpress<br \/>\nI have moved my server data PHP + WordPress and database(mysql) from one server to another server&#8230; All things working fine&#8230; but some time i got page blank in click submit button.. This problem occures some time ..I didnt get any error or fatal error in errorLog file and not get access entry in accsessLog file also on time of blank page.. Black page issue occurs some time on same taskSo how can I fix this problem..<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/481707331ea4d07ae2490bb88ddfd7ca?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nScott Pack<br \/>\napache-2.2 php centos<br \/>\nSo the same code works on my Ubuntu server but when I upload it to my dedicated hosting server running CentOS it seems to add an extra prefix of .:\/usr\/share\/pear:\/usr\/share\/php: I tried setting includepath to different things but it just doesn&#8217;t work. The file is in a directory called language in the same folder as the file that is including it and I&#8217;m using:include dirname(__FILE__).DIRECTORY_SEPARATOR.&#8221;language&#8221;.DIRECTORY_SEPARATOR.&#8221;storage.inc&#8221;; include dirname(__FILE__).&#8221;\/language\/language.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3867e5562a0c8382d6149f916b524d48?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmike<br \/>\nphp cpanel pdo<br \/>\nGetting this error: Fatal error: Class &#8216;PDO&#8217; not foundHave these lines in php.ini:extension=pdo.so extension=pdo_sqlite.so extension=sqlite.so extension=pdo_mysql.soThis shows up in php.info()&#8211; &#8211;enable-pdo=shared&#8217; &#8216;Have access to whm but there is no &#8220;software&#8221; tab from which to access easyapatche? Any suggestions??<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/efa357df02849a87e77de7377bfcd730?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMahbubur R Aaman<br \/>\nphp centos zend-framework<br \/>\nShows PHP Fatal Errormain(): Failed opening required &#8216;Zend\/Loader.php&#8217;I have installed ZF on \/usr\/share\/phpzf command is working. I can create project and do other works using zf command. But while including the library path then shows the error.Am i missing something?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dcfb3f966fc5d6ef1f37aa0e14e7ae1f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPassionate Developer<br \/>\napache-2.2 php<br \/>\nI am getting below errors despite setting memory_limit in php.ini to 64mb:Fatal error: Out of memory (allocated 6291456) (tried to allocate 91284 bytes) in \/home\/favstayc\/public_html\/coverbuddy2\/cake\/libs\/configure.php on line 1067What could I change to fix this issue?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/949e93aea69788cc3e8ce672a83da762?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBlaM<br \/>\nphp iis7 stdout stderr<br \/>\nOkay, this is slowly getting annoying. I&#8217;m used to work with Apache Webservers and never had any of these problems. IIS seems to try to be intelligent &#8211; or whatever.Here&#8217;s my situation: My customer wants a PHP website and it is supposed to run on an Windows IIS webserver.For my development environment I could use my Apache &#8211; but just to be sure I want to do it with IIS, too. So I set up a dev-server with Windows Vista, all the latest Updates and installed IIS. Everything fine!I quickly found ins<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/190363ec30ddc9f3a9dde0888bfe224e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWerkkreW<br \/>\napache-2.2 php varnish<br \/>\nWe recently migrated our site to a load balanced apache cluster behind varnish. Since that time a very small subset of users is reporting they cannot view any pages. I have narrowed the issue down quite a bit. This issue was not present before the move, the old infrastructure was a single large box.We are on Rackspace Cloud running 8 apache2 instances behind varnish 3.0 all load balanced using Rackspace Cloud load balancers (Zeus) and 2 mysql instances for a total of 10 servers, all linux.Use<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/LbXVy.jpg?s=32&amp;g=1\" \/><br \/>\nUvais Ibrahim<br \/>\nphp php-extensions pecl expect<br \/>\nI got some serious error while installing expect extension in PHP.I ran sudo pecl install channel:\/\/pecl.php.net\/expect-0.3.1I got error like this while running make,running: make \/bin\/bash \/tmp\/pear\/temp\/pear-build-rootvXp7LZ\/expect-0.3.1\/libtool &#8211;mode=compile cc -I. -I\/tmp\/pear\/temp\/expect -DPHP_ATOM_INC -I\/tmp\/pear\/temp\/pear-build-rootvXp7LZ\/expect-0.3.1\/include -I\/tmp\/pear\/temp\/pear-build-rootvXp7LZ\/expect-0.3.1\/main -I\/tmp\/pear\/temp\/expect -I\/usr\/include\/php5 -I\/usr\/include\/php5\/main -I\/u<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9fc5a15f52c68f1cbcf6c1d47fdca21c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJustin808<br \/>\nphp http httpd hostgator<br \/>\nOK, so I&#8217;m uploading a 350meg zip file. The file one uploaded is unzipped and the contents are processed. The processing consists of reading in a data file, then copying and thumbnailing images, the adding data to a database. This is all once process start to finish. I can see in the log that the datafile is processed. I can see on the filesystem the thumbnails get created. But then it looks like the whole this starts over from scratch with blank post data and it fails.When I look at the httpd l<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c534010006da1d80a2f43ba87b8bee40?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMild Fuzz<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/65f6c2e51c4ca993e7944a22d8d06971?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntoscho<br \/>\ntheme-development errors<br \/>\nAfter installing this videozoom theme i&#8217;m getting this error:Parse error: syntax error, unexpected T_ENDWHILE in \/home\/moviesa1\/public_html\/test99 dot info\/wp-content\/themes\/videozoom\/wpzoom_featured_posts.php on line 1my site: http:\/\/test99.info\/ &lt;?php$args = array(&#8216;showposts&#8217; =&gt; $wpzoom_featured_posts_posts, &#8216;orderby&#8217; =&gt; &#8216;date&#8217;, &#8216;order&#8217; =&gt; &#8216;DESC&#8217;);$featType = $wpzoom_featured_type;if ($featType == &#8216;Tag&#8217;) {$args[&#8216;tag&#8217;] = &#8220;$wpzoom_featured_slug&#8221;;\/\/ Breaking tag slug }<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b772f87cd7ddc15957c276050b4b2ff1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1632018<br \/>\nphp theme-development functions jquery hooks<br \/>\nI am developing a theme and I have called jquery along with other JS files from a theme-enqueue.php file. For some reason only the Jquery file that is hosted on googles servers is adding the theme URL into the URL path so it is not loading it and causing other JS files to not load properly. The hook is done properly and it is pointed only to their server and does not include a get_bloginfo or get_template_uri.The file it is adding my theme URL to is:&#8217;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/83947327fdbe8fcfd40fc6afb371f6a8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAdam Matan<br \/>\ntheme-development<br \/>\nTwitter has just came out with a new web framework called Bootstrap. What&#8217;s the right way to use it within a theme?Update: The stylesheet inclusion is simple indeed. I want to know which caveats or compatibility issues I should expect.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b772f87cd7ddc15957c276050b4b2ff1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1632018<br \/>\nphp theme-development functions customization errors<br \/>\nI have been working on a theme for a few days and when I realized my JS file for my theme customizer wasn&#8217;t updating I decided to clear the cookies and cache, and wow that was problematic. As soon as I did that I recieved this error many times, mainly stating the file I am working on(customize.php and the other file it said was pluggable.php:Warning: Cannot modify header information &#8211; headers already sent by customize.php After I tried to login I am now receiving this error:Parse error: syntax e<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bf7d6ba25096e4aec79f1a3e5f3dc590?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFulvio<br \/>\ntheme-development templates directory variables globals<br \/>\nOne WordPress function I happen to use frequently is get_template_directory_uri(). While I tried to minimize or avoid its use where I can, I still happen to have more than one call to this function in certain pages across my theme. Most of the time in a series of href or inside other functions (for which I normally put the URI resulting from get_template_directory_uri() in a $variable &#8211; however I still find that I might have to store again that variable in a different php file).I wonder, would i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a5d04cb72f2f263f8263e087a8d2bc55?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGazillion<br \/>\ntheme-development search post-type<br \/>\nSo I think I might be doing something fundamentally wrong in my WordPress themes since this issue seems to crop up every once in a while and I don&#8217;t know why.So basically I created search.php and I use relevanssi to sort my search results by relevancy. When I search for &#8220;camera&#8221; and do echo get_post_type(); I get &#8220;reviews&#8221; but if I search for &#8220;test&#8221; and do echo get_post_type(); I get &#8220;articles&#8221;. I tried injecting wp_reset_query() just about everywhere to try and see if I was changing it randomly<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6a350b21fd58489ac951a72324548184?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNoBugs<br \/>\ntheme-development themes html<br \/>\nI noticed that the default WP theme uses force_balance_tags for listing posts&#8217; excerpts. This way, it doesn&#8217;t cause major html breakage whenever someone writes a post like&lt;div&gt;&lt;b&gt;This is an excerpt. &lt;!&#8211;more&#8211;&gt; and this is more text&#8230; &lt;\/b&gt;&lt;\/div&gt;It will close tags instead of bolding everything, and breaking div.Why doesn&#8217;t the normal wordpress page do this by default, in the default theme? That way, broken page content like:&lt;\/div&gt;&lt;\/div&gt; now text is not w<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/54eb15d380886c7cc66dd580153f75d6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTom J Nowell<br \/>\ntheme-development plupload<br \/>\nI am developing a theme which needs uploading from front-end. I want to integrate plupload in my theme while keeping in mind that:Uploading will be handled upon form submission, and not from the plupload regular method. This means that I just need the design of plupload, and not the uploading functionality. After selecting the files, when I submit the form (containing selected files and other information), I should be able to grab all the form info (including files info) in the target page. E.g.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/224bb0695e4ebd7888953a61fd03f35a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonnyPlow<br \/>\ntheme-development pages installation<br \/>\nI&#8217;m trying to build a theme which would require specific pages to be included. Is there a way to automatically create pages and assign them to their page templates when a theme is installed?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fee8e31e1543e0fd98fe80cf719f879f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMayeenul Islam<br \/>\ncustom-post-types post-meta order custom-post-type-archives<br \/>\nI am building a movie archive. For each movie I am filling out the release dates for 3 countries, they&#8217;re stored as custom fields (added via Pods)Now, when listing the movies I would like to build an array and loop through each post to check if the fields have values, then compare the values and sort by the first date (oldest or least recent date). If none of the fields have values the posted date should be used for sorting. I am already sorting posts of some categories and their child categorie<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/65f6c2e51c4ca993e7944a22d8d06971?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntoscho<br \/>\nplugin-development database post-meta<br \/>\nWhen developing plugins that requires data storage, what&#8217;s the pros and cons of using one method or another ?The explanation given in the codex is not detailed:Before jumping in with a whole newtable, however, consider if storingyour plugin&#8217;s data in WordPress&#8217; PostMeta (a.k.a. Custom Fields) wouldwork. Post Meta is the preferredmethod; use it whenpossible\/practical.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/65f6c2e51c4ca993e7944a22d8d06971?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntoscho<br \/>\ncustom-post-types custom-field metabox post-meta single<br \/>\nI have some problems displaying info from my custom meta box in my custom post type single. I&#8217;m using Reusable Custom WordPress Meta Boxes by Tammy Hart.I&#8217;m able to display the textfields using this:&lt;?php echo get_post_meta($post-&gt;ID, $prefix.&#8217;hjemmeside&#8217;, true); ?&gt;But I can&#8217;t get the image to display, instead DEBUG is telling me that it is an &#8220;Undefined variable: post_meta_data in&#8221;. Currently I&#8217;m using this script:&lt;?php$custom_image = $post_meta_data[&#8216;image&#8217;][0];echo wp_get_attachme<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e925110b34b3782d9205935827a08746?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nguiniveretoo<br \/>\nmetabox javascript post-meta<br \/>\nI am working on creating custom meta boxes for the back-end of WordPress.I would like to add a metabox with several fields, in my case an image upload and a text input, but with a button that can duplicate both fields.I&#8217;ve been following this tutorial and it works fine.But since I want to duplicate multiple fields (as mentioned earlier, the media uploader and text input), the above tutorial does not quite fit. There is only 1 input text used.Now I have found the following source code, which corr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b51b5cc4ac03ec4f688fc9ae5908a663?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmathiregister<br \/>\ncustom-post-types post-meta loop get-template-part<br \/>\nMaybe I simply do not understand what get_template_part() is doing .I have a file called event-list.php that should work as template for other pages and files so all my events (a custom post type) get listed!Inside this event-list.php I have this .&lt;?php $loop = new WP_Query( $args ); while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post();$wr_event_fields = get_post_custom();$event_date_timestamp = $wr_event_fields[&#8216;_wr_event_date&#8217;][0];$event_date = strftime(&#8216;%d.%m.%Y&#8217;, $event_date_timestamp)<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/348c0282a4eb59564cd3af08ded3c9b0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBobrov Alexey<br \/>\npost-meta columns<br \/>\nI have some trouble.\/* Catalog *\/ function my_post_type_catalog() {register_post_type( &#8216;catalog&#8217;,array( &#8216;label&#8217; =&gt; __(&#8216;Catalog&#8217;), &#8216;public&#8217; =&gt; true, &#8216;show_ui&#8217; =&gt; true,&#8217;show_in_nav_menus&#8217; =&gt; true,&#8217;rewrite&#8217; =&gt; true,&#8217;hierarchical&#8217; =&gt; true,&#8217;menu_position&#8217; =&gt; 5,&#8217;supports&#8217; =&gt; array(&#8216;title&#8217;,&#8217;editor&#8217;,&#8217;thumbnail&#8217;,&#8217;excerpt&#8217;)) );register_taxonomy(&#8216;catalog_cat&#8217;, &#8216;catalog&#8217;, array(&#8216;hierarchical&#8217; =&gt; true, &#8216;label&#8217; =&gt; &#8216;Catalog category&#8217;, &#8216;singular_name&#8217; =&gt; &#8216;catalog_category&#8217;)); }a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5bee4e3e9b196090fd4fde76977beae6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSteve<br \/>\nplugins post-meta facebook excerpt<br \/>\nMy site has Facebook social graph meta tags in its page:&lt;meta property=&#8221;og:title&#8221; content=&#8221;First Look at Dwarves from The Hobbit&#8221;\/&gt; &lt;meta property=&#8221;og:description&#8221; content=&#8221;Movie&#8221;\/&gt;The only Facebook-related plugin I have installed Facebook Page Publish.Why is it only picking up the category of the post? There are no options to configure the og meta tags of this plugin.UPDATEI now figure I can use the post excerpt as the value for og:description, but whenever I use either of these fu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6569f0437f602650bcf37c697c4ef479?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSanjib<br \/>\ncustom-post-types posts php theme-development post-meta<br \/>\nI&#8217;m using the ClassiPress theme as a base for a new theme. If you have worked with classipress, you should know only which post title submit form font end this is display in post title, i am trying to insert city name &#8220;which is also submit form font end&#8221; after post title..i am trying to cp_get_price($post-&gt;ID, &#8216;cp_city&#8217;); then display &#8220;Rs. city name&#8221; when i use php cp_get_city($post-&gt;ID, &#8216;cp_city&#8217;); then display Fatal error: Call to undefined function cp_get_city() in single-ad_listing.php on<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f0ecb1a273c213a8b3f4bcd313f3f584?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKevin<br \/>\ncustom-post-types post-meta save-post<br \/>\nI&#8217;m using a custom post type with custom meta fields, but autosave and the &#8220;unsaved changes&#8221; dialog don&#8217;t seem to be triggered for these custom meta fields. Autosave isn&#8217;t as important to me as the unsaved changes dialog &#8211; is there a way to trigger it?function add_meta_boxes() {add_meta_box(&#8216;places_location&#8217;, __(&#8216;Location&#8217;), array(&amp;$this, &#8216;location_box&#8217;), &#8216;place&#8217;, &#8216;normal&#8217;, &#8216;high&#8217;); }function location_box($post) {wp_nonce_field(plugin_basename(__FILE__), &#8216;places_location_nonce&#8217;);$lat = get_p<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3304923b8992f922f6f133bb3fcadaf2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbooota<br \/>\npost-meta<br \/>\nI am working on a project which has a functionality of &#8220;featured_posts&#8221; based on this discussion. I have created a table which lists all the posts. I have a checkbox in each row which upon click submits the for through javascript. when the box is checked, it updates everything and marks the post as featured. As a test, i disabled all the featured posts. Upon unchecking the last checkbox, i got Warning: Invalid argument suppliedwarning. My code is foreach( $_POST[&#8216;list_id&#8217;] as $listID ) {if( upda<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>kaiser custom-post-types search The default WordPress search setup isn&#8217;t really working for my website&#8217;s setup.I have two custom post types (species, glossary) which I&#8217;d like to search for, as well as the standard post type.The species post type (which I&#8217;ll refer to herein as species profiles) is made up of a number of meta fields, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-6443","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-zend-framework"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6443"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6443\/revisions"}],"predecessor-version":[{"id":8934,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6443\/revisions\/8934"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}