get_post_type() and WP_QUERY issue

If you look at the source and the Codex page for get_post_type you will see that returns the type of the “current post” unless you pass it a post ID or post Object. get_post_type should work without a parameter if you are running that code on the post edit page(s) generated by WordPress for post … Read more

Creating plugin using simple_html_dom parser?

Maybe I’m missing something, but in your first print_r($articles), the global variable $articles is in the scope of the getArticles() function, so we’re all good there. But, in your second print_r($articles), which is happening after the closing brace of the getArticles() function declaration, $articles has not been globalized. So, it’s just set to the empty … Read more

Woocommerce disable shopping cart based on user roles

The Catalog Visibility Options plugin sounds like it would do what you want. It can disable the shopping features for “guests” and allow them for registered/logged in users. Then if you want to add a Quote form you could use Gravity Forms + WooCommerce Gravity Forms Add-ons. You might be able to use the “conditional … Read more

Redirection based on location but without affecting search bots

Search Help Google to determine the site language and to serve the right page for the users in different countries. Mark up language attributes correctly. Use <html lang=”en_UK”> and <html lang=”en_US”>. Use <link rel=”alternate” hreflang=”x” /> in page <head>. It’s also important to specify site targeting in Google Webmaster Tools. Referrers I believe people residing … Read more

How to add a full edit link to front-end editor?

I assume the plugin is a separate thing and does its work by itself. What you need is to include in your theme template files the default Edit button. First off, you need a good code editor. Notepad++, Sublime Text, NetBeans, to cite a few. Check one of the default WordPress themes, TwentyTen, TwentyEleven or … Read more

Debugs/errors in oqey gallery

Undefined Index The first and third are the same problem: if($_GET[‘type’] == “oqeygallery”){} and if(is_admin() && ($_GET[‘page’]==’oQeysettings’… Basically are: if ( $_GET[‘foo’] == ‘bar’ ) The problme is that $_GET[‘foo’] is not set. That is, the $_GET array does not have a ‘foo’ key. The solution is to wrap $_GET[‘foo’] in an isset() conditional: if … Read more

Edit Yoast SEO breadcrumbs output [closed]

They are all null. You haven’t set any of those variables. Here is your function. function ss_breadcrumb_output() { return apply_filters( ‘ss_breadcrumb_output’, ‘<‘ . $wrapper . $id . $class . ‘ xmlns:v=”http://rdf.data-vocabulary.org/#”>’ . $output . ‘</’ . $wrapper . ‘>’ ); } All of the variables in that function are isolated to that function. Variables set … Read more