Create a Wordpress shortcode using PHP I am currently using the following code within single.php (after the_content) This gets the store_name from custom field as $merchant from the post and then returns a list of products from that merchant from and external script.  &lt;?php $merchant = get_field('store_name'); echo '&lt;h3&gt; Random products from ' . get_field('store_name') . '&lt;/h3&gt;'; $external_baseHREF = "http://www.website.com/store/"; $external_path = "/home/website/public_html/store/"; $_GET["q"] = "merchant:".$merchant; require($external_path."searchExternal.php"); ?&gt;       This is working fine, however I cannot move the position of where the products are appearing, they currently appear after the main post.  I would like to have them appearing further up the post, and one solution I have considered is adding them via a shortcode so I can position them as I like eg  [merchant-name merchantname="Adidas"] or something similar  Can you please assist in creating this shortcode? Or offering alternative solution.  Thanks Richard
how to create shortcode in wordpress So I have the following code:   &lt;span class="delete"&gt;&lt;a onclick="return confirm('Are you sure?');" href="&lt;?php echo wp_nonce_url( add_query_arg( array( 'action' =&gt; 'my-delete-product', 'product_id' =&gt; $post-&gt;ID ), my_get_navigation_url('products') ), 'my-delete-product' ); ?&gt;"&gt;&lt;?php _e( '삭제', 'my' ); ?&gt;&lt;/a&gt; | &lt;/span&gt;   It is a simple button.  I want to make this into a shortcode so that I can use it anywhere where appropriate.  Any suggestions?  Thanks.
Does the derivative of a continuous function goes to zero if the function converges to it? How can I work with file uploads during a Webdriver test? This is a canonical question, intended to provide a comprehensive answer to many related questions  During the course of a Webdriver test, I want to upload files. However, this opens a native file picker, which Webdriver doesn't seem to support interacting with. How do I interact with it? Run multiple Python scripts in Blender from the command-line I have 8 python scripts and I need to lunch them at once. For one script, I used   blender --background --python script1.py   for the eight scripts, I tried this command but it does not work.  blender --background --python *.py What happens to matter in a standard model with zero Higgs VEV? Quick question about ideals of field $F$ in $F[x]$ are principal. Just got a question about ideals of $F[x]$ being principal with $F$ being a field.  The proof basically starts assuming $g(x) \in N \subset F[x]$ where $N$ is an ideal and $g(x)$ is a minimal degree element. The rest is just deducing the what the division algorithm says.  But my question is that shouldn't we let $g(x)$ be arbitrary? Why are we choosing the minimal element? Base64 Encode String in VBScript I have a web service load driver that's a Windows Script File (WSF), that includes some VBScript and JavaScript files. My web service requires that the incoming message is base64 encoded. I currently have a VBScript function that does this, but it's very inefficient (memory intensive, mostly due to VBScripts awful string concatenation)  [Aside; Yes, I've seen . The concatenation is happening in a loop across messages that are 1,000's to 10,000's bytes in size.]  I've tried using some custom string concatenation routines; one using an array and one using ADODB.Stream. These help, a little, but I think it would help more if I had some other way of encoding the message rather than via my own VBS function.  Is there some other way of encoding my message, preferebly using native Windows methods? Why two objects get charged by rubbing? In calculating work done by a constant force over a constant distance, why doesn't the subject's initial velocity matter? Assume a point-mass $m$ is travelling in a straight line, and a force $F$ will act on $m$ (in the same direction as $m$'s velocity) over a constant distance $d$; why doesn't $m$'s velocity matter to the calculation of work done on $m$ by $F$? Work is defined such that, in this example, the work done by $F$ on $m$ is equal to $Fd$, but it seems that if $m$ were moving slower, it would spend more time in the field, allowing $F$ more time to act on $m$, thereby doing more work. In fact, if $m$'s velocity were very great, it would hardly spend time in $F$'s field at all (so very little work done). Maybe I misunderstand work; can someone address this confusion of mine? I need to end my visa waiver period when leaving States to Canada so that I don't exceed the period of 90 days. But form I-94 is no longer a physical card, it's only online.  How do I know or ensure that it will be terminated and will not continue counting the days once I leave to Canada? How to interpret the margin of error in a poll? Recently the media reported on a political poll that stated that "46% of Republican voters in Mississippi think that interracial marriage should be illegal".  One example story (of many around the 'net) is this one from the NY Daily News: .  From that article:     A survey conducted last month shows 46% of GOP voters in the state   believe interracial marriage should be illegal - a plurality of the   people questioned   Given that I know many people in interracial marriages (including in my own family) I was motivated to track down the full story rather than fall to the obvious hysteria.  I located the press release on the poll from Public Policy Polling  (PDF)  which has:     46% of these hardcore Republican voters believe interracial marriage   should be illegal, while 40% think it should be legal. With Barbour   included, Huckabee gets more support (22%) from the former than the   latter (15%), as does Palin (13-6). The support for Bachmann (10-2),   Gingrich (13-8), and Pawlenty (4-1) works the opposite way.   And at the end of the first page they state:     PPP surveyed 400 usual Mississippi Republican primary voters from   March 24th to 27th. The survey’s margin of error is +/-4.9%.   Now what I don't understand is how to interpret the results especially the margin of error value.    From the raw numbers, 46% (~50%) of 400 voters is 200 voters who responded who think that interracial marriages should be illegal.  But from stats of Mississippi in the 2008 Federal election, McCain polled about 725,000 Republican votes (to Obamas 556,000). My gut feeling is that you can't extrapolate that 46% number to the other 724,600 Republican voters and still retain a 5% margin of error.  So is the media misrepresenting the numbers (really? the media would do that?!?!?!) Or are there statistics at work that I don't understand?  Thanks for your help! 2/15/18 compiz update broke unity This  forced removal of unity and ubuntu-desktop on my 16.04 Ubuntu system.   The offending package that is missing, but unity needs, seems to be compiz-core-abiversion-20151010. It seems to be a , and I can't find it to download.    As it happens, I mostly use LXDE on this system, but I'd be very unhappy if I used Unity...  Since I do occasionally use the Unity desktop, is there a fix for this?  Edit: related questions are rolling in. Looks like a major quality escape          Edit 2: How can I include custom post types on a tag page? I'm using custom post types, but they don't appear on tag pages along with regular posts and i'd like to include both standard and custom post types on tag or category pages. What would be required before the loop to include all posts? (including custom type). Updated: To add, I found this code , which worked perfectly for the first part: add_filter('pre_get_posts', 'query_post_type'); function query_post_type($query) {   if ( is_category() || is_tag() &amp;&amp; empty( $query-&gt;query_vars['suppress_filters'] ) ) {     $post_type = get_query_var('post_type');     if($post_type)         $post_type = $post_type;     else         $post_type = array('post','cpt'); // replace cpt to your custom post type     $query-&gt;set('post_type',$post_type);     return $query;     } }  Second question still remains though: Is there a way to allow readers to filter by post type? So either of the following would work..  example.com/tag/blue?post_type=custom example.com/tag/blue?post_type=post Where can the viewport clipping parameters be changed? Is it possible to produce such design hints (on elements padding, spacing, width, height) automatically in photoshop? Is there any plugin that can potentially do this? Allow adding bounties from the iOS & Android app (I was surprised I couldn't find this in an existing question, so here goes)    I'd like to add a bounty to a question, but I'm too lazy to go get my computer or a web browser. I like the SE app, and want to use it to do everything. I can't find the button to add a bounty to a question.  Please add this button, I really want to be able to add bounties to questions from the app. I believe it is what the Germans call "". English itself has no such equivalent word. (Although it has been adopted as a .)  Does an idiom exist that describes it? How to map stock ticker symbols to ISIN (International Securities Identification Number)? How can I can convert ticker symbols (which include information on the exchange) to an International Securities Identification Number (ISIN) (which contains no information on the exchange)? Also I am interested in the other way round — given an ISIN and a market identification code (MIC) how can I determine the ticker symbol? Any databases around? Is there a way to turn option strict off for just a single line of code?    I'm doing some maintenance work and I need to "cheat" in just one place and I don't want to lower the standard for the entire file. Extraneous solution from substituting in equations I came across this example of how you could end up with an extraneous solution but I was wondering how it arose. We have the equation: $$x^2+x+1=0 $$ Since x=0 does not satisfy the equation, you can divide by x on both sides which yields: $$x+1+\frac{1}{x}=0$$ which is equivalent to our first equation. From our first eqution we can conclude that: $$-x^2=x+1$$ We now substitute that into the second equation to get:$$x^2=\frac{1}{x}$$ which results in $$x^3=1$$ which is equivalent to our previous equation since x cannot be 0. However, one solution from our last equation is x=1, which is not a solution to our original equation. I have a vague idea that it may have to do with the fact that you get a cubic equation and you began with a quadratic, and that steps imply the following and not vice versa, but can you provide a very detailed answer as to why it arises? Can you please provide more examples? Why do I have to press Ctrl+D twice to close stdin?