Tag Info

New answers tagged

1

Scripts should be enqueued on wp_enqueue_scripts action hook, which runs after init action. So dequeuing on init won't work because sripts are not enqueued yet. Before enqueued scripts are printed, wp_print_scripts action is triggered so you can dequeue or unregister scripts safely at this moment: add_action( 'wp_print_scripts', 'drw_timelinr_dequeue' ); ...


0

If loadScripts() is registered/enqueued correctly (the code posted doesn't show the hook used) then is it enqueued on wp_enqueue_scripts which runs well after init so what you are doing is trying to remove something that hasn't been added yet, and will be added later. Assuming that: add_action('wp_enqueue_scripts', 'drw_timeline_js', PHP_INT_MAX); ...


0

You can't override the function(s). They aren't meant to be overwritten. See: "Override parent theme function that is not hooked or in the functions.php file" and "Is it possible to disable a function of a parent theme?". That is the direct answer to your question. You can, however, almost certainly achieve the result you want by using the filter provided ...


1

The most common would be /wp-content/themes/your-theme-name/style.css but this may not be the case depending upon the theme you are using. The easiest way to find out is to use Chrome Developer Tools. In Chrome open your website and right click on the element you would like to alter the CSS for, then click 'Inspect Element'. The CSS files and classes which ...


2

You are missing the Template: definition in your stylesheet header. This is the folder name of the parent theme For instance, a child theme of the bundled theme will have the Template: defined as Template: twentyfifteen


0

When you are using third party themes then always create the child theme for the third party theme because they always do changes and update the theme version so it will over write all your customization in your theme. You can get help how to create child theme here https://codex.wordpress.org/Child_Themes


0

this will removes all of the theme_mod settings function reset_newtheme_options() { remove_theme_mods(); }


0

Multisite Enhancements is plugin that apparently does a lot of stuff, including showing which blogs use which plugins. I haven't had a chance to try it myself, but I've had my eye on it. If you wanted your own code, vs. using a plugin, I suppose you could poke around inside the plugin to see how it works for them.


0

You need to use the post__in parameter and pass an array of the page ID's to the parameter. You can do the following: (Note: you need to use the array syntax in WP_Query if you pass post__in as an argument) <?php $the_query = new WP_Query( array( 'post_type' => 'page', 'post__in' => array( 1, 2, 3 ) ) ); ?> Just change 1, 2, and 3 to the ...


1

Sounds like there are two parts to your query: 1) Stop the first post from showing the full content, and 2) show the featured image on all the posts. 1) At the moment, the first post is using a different template to the other posts. To make the posts consistent, change this in index.php: get_template_part( 'content' ); to this: get_template_part( ...


0

One of the solutions that I've found, is to store the set get_theme_mod($name) into a PHP $_SESSION["$name"]. If the session exist, compare the new get_theme_mod($name) to that old $_SESSION["$name"], if they're not the same then // do something..: // Check if the user is an admin for validation to improve performance. if (current_user_can( 'manage_options' ...


0

The theme is using custom post type and you are right to worry about using it. If you start using this theme, you are doomed in the sense that you can't change it later without breaking the site. My personal opinion on theme is that it should only work on the visual aspect and leave the functionality part to the plugin. But so many themes break this rule ...


1

See Wordpress Template Hierarchy and figure out which page you've to modify. From this figure, it's easy to see that if you want to modify your homepage, you have to modify frong-page.php. It it doesn't exist, check if a custom page template is used to serve the home page and edit that page template. If front-page.php doesn't exist and you are not using ...


0

The theme is using a custom post type, in this case, "lyrics". Converting the old posts over to it should be as simple as writing a single query to update the old posts to the new post type. The query will be something like: UPDATE `wp_posts` SET post_type = "lyrics" WHERE post_type = "post"; Just as an added precaution, run this one first to ensure that ...


0

I am not exactly sure what you're question is but I think you are looking for something like this, mostly cribbed from the Codex: if ( is_active_sidebar( 'sidebar-1' ) ) { ?> <ul id="primary"><?php dynamic_sidebar( 'sidebar-1' ); ?> </ul><?php } If the sidebar is not in use, no markup will display. You could add ...


0

Thanks a lot. I have checked and i found that the problem is on the Theme-options code. i have used Option tree plugin inside of my theme instead of installing the plugin. But I don't know why it works on local and doesn't work on website.


1

This answer will be long, but can be helpful in some way. First of all, detect why you're getting this error: Majority of the time when you see a Wordpress' White Screen of Death, it means that you exhausted the memory limit of your server settings. This could be caused by a plugin that you may be using that is not functioning properly. It could also ...


0

You can look at the source code and search for common URLs to such a script. But that will just show you something useful when a theme is using that script. If you find nothing, the script might still be part of the theme code. Themes on wordpress.org are not allowed to include TimThumb (as far as I know), so they are safe for your specific use case, at ...


0

It all has to do with readability, specifically the width of a line of text. Research shows that text can be read faster when a line contains 95 characters per line versus other common line lengths. Couple this with designers' love of small type until the last year or so, and you're stuck with a width-constrained container around the otherwise responsive ...


0

It's simple just you need add items_wrap parameter: wp_nav_menu( array( 'theme_location' => 'top-menu', 'container' => false, 'menu_class'=> 'mainmenu pull-left', 'items_wrap' => '<ul class="nav">%3$s</ul>', ));


0

You already did it the right way. If you take a look in the Documentation for wp_nav_menu, you'll see that menu_class is the right option for the UL's class: wp_nav_menu( array( 'theme_location' => 'top-menu', 'container' => '', 'menu_class'=> 'mainmenu pull-left *add-your-class-here*' ) );


1

Your problem is that you've used the get_template_directory_uri() function for your include path. As indicated by the function name, this returns a URI (not a path), which is no use for including one php file into another. Simply enter the relative path of the file to be included. E.g. if your structure is: /my-theme |--functions.php |--/lib ...


0

In my opinion, your functions file can be as big as you want it, but organizing functions into includes is a very logical process. I would first check that get_template_directory_uri() is returning the correct path. You can also include files without the full path within your theme if /admin/ is in your theme root: ...


2

I always break my functions.php up into more managable, specific functionality files, for instance, all footer related functions goes into a file called footer-functions.php and pagination functions goes into a file called pagination-functions.php. This way, my code stays organised, managable and I don't kill my functions.php. This however, is only related ...


0

you must learn about PHP, HTML, CSS and JavaScript before create WordPress theme. you can learn here. At the very minimum, a WordPress Theme consists of two files: style.css index.php style.css provides details about the Theme in the form of comments. style.css will contains theme header information like: /* Theme Name: Twenty Thirteen Theme URI: ...


0

Your first question where you can learn about bootstrap theme development? I will suggest you go to tutorialrepublic website and search about bootstrap If you got problem with the coding just go to LayoutIt website, this development website will help you to create a bootstrap website. Just a drag and drop like a wordpress. Second questin how would ...


0

One of the key questions to consider is whether you want to try to modify an existing theme or if you want to build on top of a starter theme. You might get to where you want to be faster by modifying an existing theme if you can find one that's reasonably close to your desired endpoint. However, you may also experience frustration if the theme you try to ...


0

Your question is actually 5 or 6 vague questions, but I'll do my best to answer as specifically as I can! In my opinion, the best way to approach this problem is to use some kind of bare bones theme template for Wordpress that will include the necessary files for your theme to be recognized by Wordpress. Once you've got the theme, you can adapt it to meet ...


0

I would suggest looking at theme's that are already out there then modify them as needed for your project.. There's one theme I know of that I think would do what you need with some very minor css modifications (not even php updates, just css)... That theme is called Divi. Good luck. --James


0

First, yes, you need to learn PHP. You can pretty much don't bother with rest of answer until you have PHP basics (at least) down. Now let's talk about WordPress and Bootstrap relationships. WordPress provides template tags. These are PHP functions that are meant to be used in template files. There is a lot of them, to output all kinds of things and data ...


2

It just take a little bit more complicated logic: function alternating_post_class($classes) { static $counter = 1; switch ($counter) { case 1: $classes[] = 'full-width'; break; case 2: case 3; $classes[] = 'half-width'; break; } $counter = ($counter == 3) ? 1 : $counter + 1; return $classes; } ...


0

Most Websites that uses Multi Lingual WordPress uses WPML plugin. It has a build in Menu Sync feature that will add different version/translation of menu for each language. Its pretty much the standard to go nowadays in terms of WordPress sites having more than one language. Check this link for more info: ...


1

Its just personal preference. People do like to design stuff in watever way they want. However, the boxed design does limit the dimensions of your images to something much narrower than what you will use in a full screen or wider design. Also, the stretched layout needs less worrying about different breakpoints.


0

If you have no coding experience the easiest would be to add a text widget in the header section and use an image of the button and make it link to where you want it to go. Just upload the image to your media and then check the URL of the image in media. Something like this: <a href="landingpageURL"> <img src="buton.jpg" alt="Button alt text" ...


0

If there is everything OK with your template file (it should be placed in root directory of your theme) and the comment is correct then there can be one more thing... There is/was some mysterious bug, that was preventing template select from appearing. You can read about this bug here: https://core.trac.wordpress.org/ticket/18324 It's closed, because it ...


0

I did not realize the page had a machine name of contact_us and not just simply contact. When I do !is_page('contact_us') it works.


1

According to WordPress template hierarchy, the page templates will fall back to page.php of the new (active) theme. You can read more about template hierarchy here:- https://developer.wordpress.org/themes/basics/template-hierarchy/


0

the best way to load css into your wordpress theme is the following code in your functions.php file: function theme_styles() { global $ver_num; // define global variable for the version number $ver_num = mt_rand() // on each call/load of the style the $ver_num will get different value wp_enqueue_style( 'style-css', get_template_directory_uri() . ...


0

Your best fix would be now to use switch_theme hook and filter the passed '$theme' argument to see if it is the current them then if not return; function nw_update_network($theme) { if ($theme !== 'my_theme_name') return; // Your code here } add_action('switch_theme', 'nw_update_network');


0

So after some time here are my findings. These are the ways I would discover websites that are using my themes: http://www.wpbyexample.com there are also other similar sites. Free support - you provide free support and users will come to ask questions, in many cases they want to show their sites, so you can evaluate problems. Link to my website in the ...


0

Solved this by creating a child-theme. In the action after_setup_theme I overwrite the image-size and it works, thumbnails aren't cropped anymore. Not sure why it isn't possible to do this in a plugin, but for me it seems that creating a childtheme instead of a plugin is the better solution anyway. The WP-Doc itself says that this is the recommended way to ...


0

You could use template_include with wp_is_mobile add_filter( 'template_include', 'mobile_front_page_template', 99 ); function mobile_front_page_template( $template ) { if ( wp_is_mobile() && is_front_page() ) { $new_template = locate_template( array( 'mobile-front-page-template.php' ) ); if ( '' != $new_template ) { ...



Top 50 recent answers are included