Posts by OriginalEXE

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says
Hi, custom taxonomy metadata is not supported right now, you can check discussion here: https://core.trac.wordpress.org/ticket/10142 Also, check this plugin which implements some ideas from that discussion: http://wordpress.org/plugins/taxonomy-metadata/
1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

No problem.

Based on your SQL above, I believe this should do the same job:

$args = array(
    'orderby'  => 'meta_value_num',
    'meta_key' => 'post_views_count',
    'fields'   => 'ids',
)

$posts_array = get_posts( $args );
1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

Hi,

1.) Always use $wpdb->prepare on your custom queries, read: http://ottopress.com/2013/better-know-a-vulnerability-sql-injection/

2.) Why not use get_posts() instead of a custom query. You can use ‘fields’ parameter in arguments array to only load post id’s, read: http://codex.wordpress.org/Class_Reference/WP_Query#Return_Fields_Parameter

3.) Use WordPress transients API: http://codex.wordpress.org/Transients_API to cache your query result. Don’t forget to also empty it once new post of that post type is made.

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

page_data is not a function. Let me explain.

You have this:
 $pages = get_pages($args);

Your $pages variable now contains an array of objects, and each object represents one page that matched your request.

Then, you are doing foreach:
foreach ($pages as $page_data) {

which iterates over every member of your $pages array, and stores each member (page object) into a variable you named $page_data.

$page_data variable now contains all the data you pulled from the database in form of an object, and you access each property of the object using an “arrow” ->, unlike in array where you would use [’’]

So when you call
$page_data->ID
, you are accessing object property named “ID”, which actually holds ID of that page object.

I hope I made it clearer.

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

Note: You don’t have a contact form on your profile, only authors do.

Just click on a green button here: http://themeforest.net/author_guide

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

Why not simply:

$postid = $page_data->ID;

By calling get_the_ID(), you are retrieving an id of the post/page in the main query (you will get back id of the post/page you are running this query on).

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

I get $2+ purchases in 80% of my transactions.

Instead of looking at it as an additional charge, one can view it as a discount if deposit is made.

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says
1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

Hi,

sure it’s allowed, we do this in all of our themes. Just make sure you include only assets you have permission for, or even better, replace all images with placeholders.

1521 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

Why are you looking for something like GitHub, when you can just use GitHub :) I was thinking about going with bitbucket because it offers Unlimited free repositories but I rather pay for GitHub ACC as I like it’s interface better.

by
by
by
by
by
by