New answers tagged

-1

Here theme names that are displayed from wp_get_themes() stores private information, as you can see [headers:WP_Theme:private] So you can't access the private variable directly. For accessing the private variable you need to inherit the parent class. Update $get_theme = wp_get_themes(); $all_theme = array_keys( $get_theme ) ); print_r( $all_theme ); //...


1

You could use switch_theme function. Accepts one argument: $stylesheet of the theme. ($stylesheet is the name of your folder slug. It's the same value that you'd use for a child theme, something like "twentythirteen".) Documentation: switch_theme


0

There is a big advantage on separating the backend from the frontend. Besides the code quality, performance and maintenance time are improved. I have created a theme using Ember.js and WP REST API ( with custom routes ) and the results are amazing. So yes, if you have the knowledge of MVC and a deep knowledge of WordPress Core, go for it.


0

Make sure you use get_stylesheet_directory_uri() in child theme and make sure that the parent theme is using get_template_directory_uri(). If the parent theme is not using get_template_directory_uri() you'll have to unregister the main style and register it again in your child theme. Cheers!


1

You are using get_stylesheet_uri() which links directly to your stylesheet, then your adding /style.css which is resulting in an invalid url. So you need to remove the /style.css. Or use get_stylesheet_directory_uri() and leave the /style.css on there.


0

If you are in wp customizer, here is how you can change the current preview URL via Javascript: Try this one when you plan to change the current URL from controls panel: wp.customize.previewer.previewUrl( url ) or try this one while you intend to change the URL from preview frame: wp.customize.preview.send( "url", url ) Moreover, here is how to get the ...


1

Setting theme dynamically is certainly possible, but not too convenient since it's hardly "normal" mode of operation. In my experience this works best if you stay away from higher level template/stylesheet hooks and instead filter underlying options. In that way you can trick WP into thinking that configured theme is different from what it is and use it. ...


0

Why don't you create a shortcode for this , it's much easier, standard and flexible.


0

Short answer: most probably there is. I would recommend you use a child theme to achieve this. You can then copy any of the parent theme's templates into your child theme and alter them as you like. In your case it's probably something like "single-portfolio.php" inside the templates folder of the theme. A good starting point for working with child themes ...


0

I see you already tried with wpseo_next_rel_link can try with this one more time. function wpseo_disable_rel_next_hom () { if ( is_home() || is_front_page() ) { return ''; } } add_filter('wpseo_next_rel_link', 'wpseo_disable_rel_next_hom'); And one more thing as per as I know that is not Yoast SEO plugin issue. You can try with WordPress Default ...


0

Each theme has one config which is associated with options. When you move theme you just have to move option in the database to the key of the theme. Tell me whether this could help you or not. Thank you!


0

May be you need this theme... Try it out it's a free theme and same as per your requirement. It's a one page website theme available on wordpress.org. https://wordpress.org/themes/one-page/ Check out the demo here https://wp-themes.com/one-page/


2

Nulled theme basically mean cracked/hacked, the distributors of nulled themes often hide popups/ads in them to earn money, which you can't see until a user complain about it or you check the website on google speed test for example where you see image of the website, they aren't secured at all, and it is doesn't worth using them. Expected behavior of nulled ...


0

What's in your Apache logs? Maybe more info about the error. Set a 755 permission on the the public_html directory Who's your hosting provider? The issue might be permissions that you, as a user, cannot change yourself (contact hosting support).


1

Well, I found not an answer, but a workaround for this question. In the_mx_limited_gallery function, I added a negated is_single check around most of the contents of the function, so basically the limited posts and custom code show only if you are on a page other than a single post. This isn't how I originally intended, but it works for the time being. ...


1

It looks like the code you copied from is missing the part where your child theme styles are actually added to WordPress. It's a little strange they skipped over this, mind you! From the WordPress Codex article on child themes, you just need to modify your style enqueueing function so it includes this: wp_enqueue_style( 'child-style', ...


4

Child themes are not the only way to extend a theme, not even the best. Many themes offer hooks: actions and filters. You can use these to change the output per plugin. Let’s say you have a theme named Acme, and its index.php contains the following code: get_header(); do_action( 'acme.loop.before', 'index' ); ?> <div id="container"> &...


-1

Write This Code On theme Function.php function run_activate_plugin( $plugin ) { $current = get_option( 'active_plugins' ); $plugin = plugin_basename( trim( $plugin ) ); if ( !in_array( $plugin, $current ) ) { $current[] = $plugin; sort( $current ); do_action( 'activate_plugin', trim( $plugin ) ); update_option( '...


1

For me the rule of thumb is am I extending/revising an existing theme? If so I'll want to be able to update the theme (assuming it's well supported) without nuking all my changes. You can read more here in the codex. If I'm creating something custom I find it best to just use my own starter theme (or something like Underscores) and edit the theme itself.


0

figured out how to accomplish my task : // function to fetch tag ID from name function get_tag_ID($tag_name) { $tag = get_term_by('name', $tag_name, 'post_tag'); if ($tag) { return $tag->term_id; } else { return NULL;} } // add categories & tag taxonomy to pages register_taxonomy_for_object_type( 'category', 'page' ); ...


0

If I get what you're asking, it's that you want a way to remove the <style> tag from your header - correct? Definitely a good idea to do this - just keep the bare minimum there. This way, styles can be managed separately to your markup - keeping the presentation layer separate is best practice. All of your CSS you can then put into an external file, ...



Top 50 recent answers are included