Posts by ThemeChills

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Hi everyone,

Let’s see if I can make this clear. I would like to know how you would go about updating a JavaScript option with a new value that is added through a widget by an end user.

For example, I have this function that contains specific options:


var feed = new Instafeed({
        get: "tagged",
        tagName: "myCustomHashTag",
});

...and what I would like to do is for the tagName option to be updatable by a user through a widget.

The above function is within a custom.js file, so I’m wondering:

  • Is there a way I can have this be dynamic through the file itself?
  • Does this need to be inline on the page where the output would exist?
  • How would I do this with PHP, or is there another way?

Hope that is clear, otherwise let me know and I can elaborate a bit more.

Looking forward to your reply.

Thanks,

Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Hi ThemeChills. Its not ‘meta_value’ in the meta _query, it is just ‘value’

Thanks @DJMiMi!

This is the approach that worked, just for anyone else that may have a similar question…


        <?php 
            $args = array(
                'posts_per_page' => 6,
                'post_type'      => 'page',
                'meta_query'      => array(
                    array(
                        'key'     => '_wp_page_template',
                        'value'   => 'homepage.php',
                        'compare' => '!=',
                    ),
                ),
            );
            $gallery_list_posts = new WP_Query( $args );        
        ?>

You guys rock!

-Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

function my_remove_page_templates( $templates ) {
    unset( $templates['page-templates/homepage.php'] );
    return $templates;
}
add_filter( 'theme_page_templates', 'my_remove_page_templates' );
The theme_page_templates filter was introduced with WordPress 3.9.

Cool, will try that out and report back on how it goes.

Thanks buddy.

Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Nudging, anyone have an idea?

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Hi all,

Hopefully this is an easy one.

I am trying to exclude a specific page that has the homepage.php page template associated to it from the view.

I have tried the below, but it doesn’t seem to work, any ideas?

Thanks,

Leo


        $args = array(
            'posts_per_page' => 6,
            'post_type'      => 'page',
            'meta_query'     => array(
                array(
                    'key'            => '_wp_page_template',
                    'meta_value'     => 'homepage.php',
                    'compare'        => '!=',
                )
            )

        );
        $gallery_list_posts = new WP_Query( $args );    

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Not sure if you’re aware of it, thought I’d make sure by saying it. If you place any of the items you have in your TF portfolio on public repo’s – or anywhere with public access to copy for that matter – you’re basically breaking your exclusivity agreement with Envato, so tread carefully. ;)

Thought of that, which is why I was not 100% in putting the codebase on a public GitHub repo. Thanks though, great point for others who may not be aware of this.

-Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says



Yes, there is a better way: 1.) Move anything but the very url to your external css, like this:
.entry-header {
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}

and only declare image url inline

2.) or use wp_add_inline_style

I was looking into point 2, but will try point 1 first. The only thing I’m thinking is whether TF will consider it as actual inline styling, though, then again they do specify that if it is dynamic content then it’s ok.

Thanks everyone,

Leo

Why would you add some many lines of code for something really simple? Inline coding is allowed and should be used in such cases. Otherwise you have to add code, or create a dynamic css file, for what? A simple background?

I think the OP’s first example if perfect.

OP’s? So you would go with option 1 you’re saying…right?

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

Hi, Do you create a repo for each Theme on bitbucket?

Thanks everyone for your insights. Decided to go with bitbucket, seems to be quite nice :)

As it stand now, yes. I have 1 repo per theme.

Thanks,

Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says

First way worked for us in our themes, it will certainly get approved.

Cool, will definitely try it out, thanks again!

Leo

129 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills says


On my blog I documented the process of how I go from concept to submitting my template to TF. I even outline my rejection reason and what I did to overcome this. http://themechills.com/creating-a-landing-page-getting-inspiration-ideas/

Note, that the series goes through a HTML template, but I’m sure you may be able to take away some of these learnings and apply it to WP just the same.

Hope it helps, thanks.

Leo
Just awesome! Thank you.

You’re welcome @dzonivejin :)

Leo

by
by
by
by
by
by