Tag Info

New answers tagged

2

The presence of style.css with a name is a hard requirement for a valid theme. From quick look through the code it's unlikely you can easily work around it. However it seems you can manipulate rest of the data. There is dynamic extra_{$context}_headers hook in get_file_data(), so filtering extra_theme_headers will probably let you splice data in from ...


0

You'll have some process of data migration and validation, so you can setup a staging WordPress environment somewhere on the same server (like staging.recepti-kuvar.rs). You can do the following: Create the subdomain and protect it with htpasswd; Create a copy of the living site, using Duplicator plugin (or any other that you find easier); Restore the ...


1

Found it!!! Pages -> Quick Edit -> untick Allow Comments


0

You can remove the comment part from the pages. Go to wp-content/themes/your-theme-name/ and open page.php In this page search for <?php // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || get_comments_number() ) : comments_template(); endif; ?> and remove or coment this whole block or ...


0

It could be a web server setting. If you use Apache, try to enable FollowSymLinks.


1

For anyone still interested in customizer export/import functionality, we just released a new plugin on the wordpress.org repo that does exactly that! https://wordpress.org/plugins/customizer-export-import/ Don’t hesitate to let us know what you think!


2

To print JavaScript code to your page, you have several paths to choose from. The most obvious would be the wp_footer action. Just hook a function to it and make it print your JavaScript/jQuery code, wrapped in <script /> tags. // EDIT As an addition, if your custom JavaScript/jquery code is static (i.e., there are no dynamic parts in it), you should ...


0

you don't need to add another function to get the search form. If you want to change the look of the search form or add another items you'll have to add the searchform.php to your theme. It could look like this: <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>"> <input type="search" ...


0

I have done this (Woocommerce 2.1) by creating a template for the product in my theme's woocommerce templates named 'content-single-product-{$product_cat}.php' and adding a 'wc_get_template_part' filter that searches for templates named after the product category. Now you can override the content-single-product template by product category: function ...


1

Scripts and styles get output with wp_head and wp_footer functions. If you enqueue a style after wp_head, it will be output in wp_footer, which, while in practice will often work, means the theme's html will not validate. It's up to you (or whomever is building a theme/plugin) to enqueue styles early enough to be output in the head. All the data you'd need ...


1

The problem, as idiotic as it may seem, was that I had inadvertently included the template name of my standard subpage template into my landing page template. WP didn't know what to do with it...


1

Using after_switch_theme will activate the theme (which is fine as we want to run the check within the context of the new theme). If the dependencies are not fulfilled ($dependencies_missing = true;) we're going to notify the user via an admin notice and instantly switch back to the theme used previously (passed via after_switch_theme as $oldtheme) ...


2

Code is not readable in comment so I am adding it here. With a little explanation. You will need to add full path of the image file to show them in theme. If your image is in theme directory then you will have to use theme directory path variable bloginfo('stylesheet_directory') with image name. So this is the code you will need to add in your theme files. ...


4

As @cybmeta already pointed out, you are too early with your removal. So you have to defer the actual removal, for instance like so: add_action( 'after_setup_theme', 'wpdev_170663_remove_parent_theme_stuff', 0 ); function wpdev_170663_remove_parent_theme_stuff() { remove_action( 'after_setup_theme', 'et_pb_setup_theme' ); }


1

The functions.php file of child themes is loaded right before the parent theme functions.php, so when you run remove_action in child theme, the action you are trying to remove doesn't exist beacuse it is added later.


2

PSD files are typically included with premium themes as an extra to allow you to customize the image assets. You have to open those files in Photoshop, edit them, and export new versions to replace the png, gif, or jpg assets that came with the theme. There's nothing in WordPress core that deals with PSD files, and the specific details of how the PSD files ...


0

(1) Make sure you've set up proper upload_max_filesize. You can use phpinfo to check / verify. <?php phpinfo(); ?> More info. on phpinfo (2) You may also need to increase your max post size. Look for this line in your php.ini file post_max_size and increase it as well. You need to restart Apache for the changes to take effect. Retry to ...


0

Try adding the following to your custom css, with 960px being your desired width. .site { max-width: 960px; } And for the background color: .body { background: #f7f7f7; }


0

Simply put in every case this depends on terms and license of specific extension. While commonly WordPress themes (more so free ones) are distributed under open source licenses this is complicated topic. If you need high level of confidence — you'll have to hire a lawyer with relevant expertise to check situation with specific themes and plugins you intend ...


0

We can't provide legal advice here, however publicly distributed themes and plugins should be GPL or GPL compatible, so long as you don't violate the GPL you should be safe. A good measure of wether a license is compatible with the GPL or not, is if it adds restrictions. If you can do it under the GPL, but not under the license, then that license is not GPL ...


1

You can use wp_add_inline_style to attach some css to dashicon style. Using that function everytime you add dashicons css via wp_enqueue_script you can automatically append some css and so modify default styles. Something like: add_action('wp_enqueue_scripts', function() { wp_add_inline_style( 'dashicons', '.dashicons { ...


0

I took a look at Bootstrap's Glyphicon CSS and WordPress's Dashicon CSS and formulated a tweak. Bootstrap Glyphicons CSS .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: 400; line-height: 1; -webkit-font-smoothing: antialiased; ...


1

You can use em sizing to make the dashicons scale relative to the font size of their containing element. This should do the trick: .dashicons:before { width: 1em; height: 1em; font-size: 1em; } Then if your <h1> element has a font-size of 48px, your dashicon will as well.


0

As I mentioned in my comment, the dashicons are meant to be part of the dashboard menu, as such they are sized very specifically: .dashicons-before:before { display: inline-block; width: 20px; height: 20px; font-size: 20px; line-height: 1; font-family: dashicons; text-decoration: inherit; font-weight: 400; font-style: ...


7

You are thinking of WordPress templates as PHP application code. Essentially they are not that. WordPress templates by design are templates using Template Tags API. It is extra level of abstraction, that just happens to allow to use rest of PHP language too. The ease of template tags serves the popularity of WordPress and extremely low entry bar for people ...


1

WordPress data is all centered around the concept of "The Post" which is really little more that a colloquialism used to describe a complex array of data stored in the database. The pieces of data in that array make sense together in context. So technically, sure, you could extract all that data from that array with a foreach if you really wanted to. But ...


2

The loop is just an abstraction of the process of iterating over the posts returned by a query. As with all abstractions you pay some performance price for not using directly the language constructs like arrays, but it creates a more readable code (hopefully) as $q->hove_posts() is easier to grasp then ($I++ < count($q->$posts)). The main reason of ...


1

Every query object contains an array of the returned posts, so technically you could use foreach to display the posts, but I don't think it would simplify anything. First of all, you'll lose the loop start and end actions, and the ability to know if code is being executed within the loop or not, but the major thing you'll lose is the current post context - ...



Top 50 recent answers are included