Tag Info

New answers tagged

0

As already stated, the method you are using is the recommended way of doing it. Wordpress is written in such a way that it will always look for a template in a child theme first if there is an active child theme before looking for a template in the parent theme. So coming to performance, there is no impact on performance as these checks are performed ...


2

Actually, what you have described is the correct way to do things and there shouldn't be any noticeable impact on site speed and performance. Using child themes also has the benefits of allowing your changes to persist through theme upgrades.


0

In general it is impossible, and probably pointless as well. It is not enough to know which theme is being used but you will also need to know its configuration and then what about different versions, local changes or even server settings (ok, this probably only in rare cases). The best way to know what theme is used on a specific site is to ask the owner ...


-1

Use site like wpthemedetector.com to detect which theme that site is using or visit that site and press ctrl+u to view its source code you will get a theme css file.In the top of the css file there would be comment about theme.


0

We need to wp_enqueue_script the script and wp_enqueue_style the style with add_action to the functions.php file. Just include a jQuery file and stylesheet file by this script. // Register Scripts & Styles in Admin panel function custom_color_picker_scripts() { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'iris', admin_url( ...


0

Probably the easiest thing to use is the date() function with the "daylight savings argument and add a custom <body> class: <?php /** Plugin Name: (#179112) Daylight savings body class */ add_filter( 'body_class', 'daylightsavings_classes' ); function daylightsavings_classes( Array $classes ) { $classes[] = 0 === date('I') ? 'winter' : ...


6

The user decides To answer your last question first: I tried adding the plugin inside the theme plugin folder [...] What am I doing wrong? You are trying to bundle functionality into a theme. That is the wrong thing in the first place. Themes offer presentation - Plugins offers functionality. Aside from that, functionality should be the users choice. ...


2

There's no method to bundle a plugin with a theme install. Your best bet would be to check if a plugin is installed using is_plugin_active in your functions.php. If not, display a notice in the admin area directing them to download/install it.


1

Unfortunately WordPress does not support third-level admin menu, so there's no easy way to achieve the result you want. You can only remove these 4 submenu items, add a submenu item instead which will be a link to a custom admin page and display these 4 links within that page (content). Read about following hooks: remove_submenu_page() add_submenu_page() ...


0

I'm still not sure what the reason why it works as a plugin, but I have successfully used the provided before/after slots in the plugin to get the correct styling. If anyone does have an answer as to why it works in the plugin without that I would be very interested in hearing about it.


1

It is very hard to guess, the bit about permissions is peculiar. The steps I would take to locate or at least narrow down the issue: Verify or reinstall core files Enable WP_DEBUG and see if there are related errors Dump get_included_files() and see if there are any unexpected/external files


0

Check user capabilities or roles when registering the navigation menu. The data will remain accessible via wp_nav_menu, but users without the capabilities won't see the location in Appearance -> Menu -> Manage locations. Note this will only prevent assigning menus to these locations. Any menu assigned to the location already will be manageable (if the user ...


0

Ended up doing this, which seems much more simple: if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != "") { // This is the Template for Category level 1 include(TEMPLATEPATH.'/location.php'); } else{ // This is the Template for Category level 2 ...


1

Go to Settings -> SiteOrigin Page Builder. Enable "Bundled Widgets" and save settings. Embedded Videos (PB) should be available now.


1

You could use the template_redirect hook to check and see if your post is a category and then whether it is a sub-category ... and if so, force a different template. For example (assuming you are using wordpress categories) function my_maybe_override_category_template( $template ) { # Make sure you are about to show a category term if ( ...


0

From the spec: "EM is Equal to the computed value of the ‘font-size’ property of the element on which it is used." You have a different font-size value between the two URLs you provided (14px and 10px respectively). Line 273 of your style.css file is replacing the default Bootstrap font-size for the body element (line 5 of bootstrap.min.css).


0

Try This code. <?php $pages = get_pages(); foreach ($pages as $page_data) { $content = apply_filters('the_content', $page_data->post_content); $title = $page_data->post_title; echo wpautop( $content ); }


0

You have to add the title attribute to the <a href> code surrounding the images that the Magnific Popup effect is being applied to. The new code should look like this: $thumb_img = get_post( get_post_thumbnail_id() ); // Get post by ID $excerpt = $thumb_img->post_excerpt; // Display Caption <a href="{current_url_here}" title="<?php echo ...


4

Change this line: Template: Default Template to Template: wp_techgostore-theme-package As per the WordPress Codex, The Template line corresponds to the directory name of the parent theme


0

Everyone has got his/her own style of writing code. Personally, I believe that using different opening and closing PHP tags makes the code easy to read and understand. Theme files carry both PHP as well as HTML code, so keeping the code clean in order to make it easy to read becomes important. Adding HTML in between also becomes easy if you separate your PHP ...


2

The posts page is a special case that's hardcoded into core- it lets a page's main query be converted to a posts query. In this situation, the posts page ceases to be a "page" in the conventional sense- is_page is false, you can't access the page's content, etc.. Doing this page-query-to-posts-query conversion with the main query for any other sort of page ...


1

OK got it. For anyone who needs to do this , it is best you extend Walker_Nav_Menu class if you just need to add things to existing wp menu structure. Otherwise if you are extending Walker class you kinda have to rebuild the menu completely. Include this class class Walker_Extend_Menu extends Walker_Nav_Menu { // Tell Walker where to inherit it's ...


1

I believe what you are looking for is a custom nav walker to control your HTML structure. The WP Codex article lists a good example for controlling the HTML structure of a menu http://codex.wordpress.org/Class_Reference/Walker#General_Menu_Example // Tell Walker where to inherit it's parent and id values var $db_fields = array( 'parent' => ...


1

Do not rely on the codex. Some pages are just a heap of crap and totally useless. The problem with the codex is that everybody with an account on wordpress.org can change and alter the codex as they see fit. I don't say, Do not use the codex, I'm saying that you need to be cautious. You need to read the codex in conjuction with the actual source code. ...


0

I think, similar to the plugin Duane mentioned, you'd most likely utilize shortcodes. Most Themes I've seen that help with post/page formatting use shortcodes to help acheive what you are talking about. Shortcode Example: [addbox type="full-width" headline="Headline Title Here"]Content goes here[/addbox] Then within the Theme code you'd recognize an ...


0

There's a plugin that achieves exactly what you're referring to. It's called Shortcake.


1

If it's just for your understanding, then install the Query Monitor plugin, which gives you a lot of information about what's going on under the hood


1

You can add below code to your child theme. @media screen and (min-width: 59.6875em) { .site-content { float: left; margin-left: 0px; width: 70.5882%; } .sidebar { float: right; right:0; margin-right: 0px; max-width: 413px; width: 29.4118%; } body:before { ...


0

As I am using the roots theme framework, this line removes the container argument: function roots_nav_menu_args($args = '') { $roots_nav_menu_args = array(); $roots_nav_menu_args['container'] = false; if (!$args['items_wrap']) { $roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>'; } if (!$args['depth']) { ...


2

This is more server config question than WordPress. Make sure the www-data group has write permissions in the directory you're running WordPress from. Assuming it's in /var/www/ then sudo chmod -R g+rwxs /var/www/ should do the trick.


0

As you error messgae, check your theme functions.php file, line no 395, you may see there have some code like } endif; Just delete those code and I hope your problem will solve.


1

You can replace the broken functions.php file, recovering it from the original theme package. From the namespace of your error message I can guess that the theme you are using could be this: https://wordpress.org/themes/catch-box Right? I hope it helps.


0

There would be no real advantages of theme vs backend since you would simply be rolling WP functions into your own framework and having to then maintain them. Doing so for the sake of a clean template is not a good idea. The only strong use case for doing this I can think of would be when you have to bootstrap a WP backend into an existing site and you need ...


2

One option would be to load all items in the nav menu into the page when it is being generated using wp_get_nav_menu_items( $menu_name, $args ) Another possible way to do that would be to use ajax to grab the page in question and append it to the end of the current content before the scroll action is fired. However, there are a few possible problems with ...


0

I suspect that your issue is occuring because the category term events does not yet exist. If the function get_cat_ID() fails it returns 0, and in turn the wp_get_recent_posts() function uses 0 as the default for the category parameter, meaning that the parameter is ignored by the function. To avoid this behaviour I suggest you check for the result of ...


1

Yes, you can enable a theme for a single site (as opposed to enabling it for your entire Multisite network). Go to the site's Edit Site backend page and select the Themes tab. The URL should be something like example.com/wp-admin/network/site-themes.php?id=[site ID]. You'll need Super Admin privileges on the Multisite network. Enable the theme(s) you'd ...


1

You could develop your own metabox for the page (with custom styling, probably) that allows selection of the template. I don't know that generating screenshots is feasible, but you could definitely have it pull from some sort of associated file (eg: template name is template-name.php, screenshot is template-name.png). With the replacement selection method ...


0

If you want to do that kind of thing your self, you could add a custom meta box that shows up only on that page template labeled something like "Second Content Area" that the user can enter additional content into for display below the center areas. Another possibility would be to place a (horizontal) sidebar below the middle content and let the user place ...



Top 50 recent answers are included