snipt

Ctrl+h for KB shortcuts
#53893

Bash

Get response headers from POST request with curl

curl -s -d 'test=test' -D- www.google.com -o/dev/null
https://snipt.net/embed/ff9964a6872571066ed5cc4c13f1674a/
https://snipt.net/raw/ff9964a6872571066ed5cc4c13f1674a/
ff9964a6872571066ed5cc4c13f1674a
bash
Bash
1
2014-04-16T09:05:57
True
False
Jan 17, 2013 at 10:26 AM
/api/public/snipt/53893/
get-response-headers-from-post-request-with-curl
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>curl -s -d <span class="s1">&#39;test=test&#39;</span> -D- www.google.com -o/dev/null </span></pre></div> </td></tr></table>
bash, curl, headers, post
#52152

PHP

Excluir current post del query

'post__not_in' => array( $post->ID )
https://snipt.net/embed/5ec4e40e664d6057d2185cc9e3a17c8e/
https://snipt.net/raw/5ec4e40e664d6057d2185cc9e3a17c8e/
5ec4e40e664d6057d2185cc9e3a17c8e
php
PHP
1
2014-04-12T20:29:05
True
False
Dec 20, 2012 at 02:46 PM
/api/public/snipt/52152/
excluir-current-post-del-query
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="x">&#39;post__not_in&#39; =&gt; array( $post-&gt;ID )</span> </span></pre></div> </td></tr></table>
current, post, query, wordpress
#42602

PHP

Excluir Post en single de un segundo Loop

1
2
3
<?php query_posts( array( 'post_type' => 'slug', 'posts_per_page' => nº, 
/* la clave */ 'post__not_in' => array( $post->ID )) );
if (have_posts()) : while (have_posts()) : the_post(); ?>
https://snipt.net/embed/cf01c0c5e19fac5c160efe1ebd7fbc8c/
https://snipt.net/raw/cf01c0c5e19fac5c160efe1ebd7fbc8c/
cf01c0c5e19fac5c160efe1ebd7fbc8c
php
PHP
3
2014-04-13T19:23:26
True
False
/api/public/snipt/42602/
excluir-post-en-single-de-un-segundo-loop
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> <span class="nx">query_posts</span><span class="p">(</span> <span class="k">array</span><span class="p">(</span> <span class="s1">&#39;post_type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;slug&#39;</span><span class="p">,</span> <span class="s1">&#39;posts_per_page&#39;</span> <span class="o">=&gt;</span> <span class="nx">n</span><span class="err">º</span><span class="p">,</span> </span><span id="L-2"><a name="L-2"></a><span class="cm">/* la clave */</span> <span class="s1">&#39;post__not_in&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span> <span class="nv">$post</span><span class="o">-&gt;</span><span class="na">ID</span> <span class="p">))</span> <span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="k">if</span> <span class="p">(</span><span class="nx">have_posts</span><span class="p">())</span> <span class="o">:</span> <span class="k">while</span> <span class="p">(</span><span class="nx">have_posts</span><span class="p">())</span> <span class="o">:</span> <span class="nx">the_post</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
exclude, loop, post, wordpress