Tag Info

New answers tagged

0

To remove the title completely from all the forms: function tml_title( $title, $action ) { $title = ''; return $title; } add_filter( 'tml_title', 'tml_title', 11, 2 );


4

Looking at the source code that WordPress uses to register widgets here, there's a $number parameter defined, in line 242, as: The unique order number of this widget instance compared to other instances of the same class. The function _set($number) stores this ID number attached to the base identifier string of the widget. Then, the function ...


0

content-single-product.php sounds like a woocommerce template, which is located here wp-content/plugins/woocommerce/templates. You can override this template in your theme or child them by creating a file wp-content/themes/your-theme/woocommerce/content-single-product.php.


2

You have misspelled the action hook name. This: add_action( 'after-setup_theme', 'ja_theme_setup' ); Should be: add_action( 'after_setup_theme', 'ja_theme_setup' ); The full code: add_action( 'after_setup_theme', 'ja_theme_setup' ); function ja_theme_setup() { add_theme_support( 'post-thumbnails'); }


-1

You need to go your wp-admin/post/ top right corner show "screen Options" click on this and expand screen-option then click on Featured Image check box Hope this help you..


-1

Your code should work , but as it is not working the try the following things add_theme_support( 'post-thumbnails'); Just put this code in functions.php , not within a function . Just put this code on the top of your functions.php file . If it is not working then try this plugin Drag & Drop Featured Image


0

There are several ways you could do this. As noted above, you can call global every time you want the value: global $fburl; echo $fburl; You can put all your config settings into a single object or array, then put that one object into the globals so it's available everywhere (doable, but not one I'd choose). One popular method is to wrap your config ...


1

The simple and quickest solution is showing categories list by using sitemap plugin with short-code. For example this plugin WP Sitemap Page. Install it and place shortcode on page. Second option is create page template for category list. Using wp_list_categories() Thanks


0

8388608 bytes is 8M, which is the default post size limit in PHP. Update your post_max_size in php.ini to a larger value, may be 50M. post_max_size sets the maximum amount of data that can be sent via a POST in a form.


1

To get a list of categories when you visit yoursite.com/topics or even the default yoursite.com/categories (doesn't matter; it's not a link structure related issue) you have to have a template for this. It's like a sitemap. If you want to show a sitemap on your front-end, you'll have to have a sitemap template. In this case, it's a category archive what ...


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

I don't think this question is relevant here. Anyways, use this code in your style.css file .container { max-width: 100%; }


0

You will need to learn the very basics of how Wordpress works and how templates interact to display content. Your question is rather broad looking at your actual problem. In short, a basic template should look like this <php get_header(); if ( have_posts() ) { while ( have_posts() ) { the_post(); get_template_part( 'content' ); } ...


0

wp_is_mobile() this function is for code the device on which you viewing site is mobile. i mean this condition will true if you view site in mobile. now as per your question you want to display slider and sidebar only in desktop then your code will be like below: 1. for sidebar if (!wp_is_mobile() ) { get_sidebar(); } 2. for slider if ...


-2

A simple guide to convert HTML template to wordpress files is here


0

I would suggest starting you WordPress development journey here: Theme Development You cannot just copy a HTML/CSS template to your server you need to build a theme.


0

Here is another option to remove header and background (source): //Remove the custom options provided by the default twentyeleven theme. add_action( 'after_setup_theme','remove_twentyeleven_options', 100 ); function remove_twentyeleven_options() { remove_custom_background(); remove_custom_image_header(); remove_action('admin_menu', ...


1

There is a build in function for this already, no need to create a custom function for this. The function is called get_term_children() and will return either An array of child terms if the given term have children An empty array if no child terms are found WP_Error object if the taxonomy does not exist With this in mind, wrap get_term_children() in a ...


0

This is what I use. The variable $cat is the category ID you are checking: $categories = get_categories($cat); if (!empty($categories)) { // This Category has children } else { // This category has no children }


0

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


0

As what I've commented, the rawurlencode() function is the reason because WordPress have a lot of restrictions. I found that, that kind of problem will exist if you have a % percent sign (in my case, produced by the rawurlencode()) in your 'default' => $value. One of the solutions, encode some or the whole part of your path with base64_encode(): $encode ...


0

I found that there's a predefined WordPress function to upload a file into the Media Library but it's only working asynchronously with a <form> element and a $_FILES array. Second, I also found that there's a second imagepng() parameter filename which is the path where you want to save the file. I tried to save it to a WordPress uploads' path such ...


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

You need to login into the ftp and follow the path shown to the url, then place your image into the theme > dikka-installable > assets > images and upload the "raster.png" file at this location.


0

I don't really know what you mean by "using the Wordpress API in a site as opposed to making it a theme" but I am assuming you mean something like "use the backend but not the front facing stuff". So, given that, yes you can, but a lot of things will not work. There are too many hooks in the WordPress core-- 'pre_get_posts' for example-- and that are ...


0

You cannot use category slug as its the default slug for WordPress category. Try register your taxonomy with some other taxonomy name like product-category and use taxonomy-product-category.php file to render individual taxonomy category layout(main1, main2 etc.) Function Reference/register taxonomy.


1

Allowing user to control code is explicitly unsafe operation. As you note the purpose of sanitization is pretty much to not let user slip in anything executable and/or with malicious intent. To "sanitize" executable code you would need programmatic understanding of it (code parser) and criteria engine to distinguish what is safe and what is not. For such ...


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: ...


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

Apparently it was a menu registration issue. That menu was readable by WordPress, but not completely, because there were no positions available. I registered again the menu into my functions.php file and it worked. Thank you all anyway.


0

In your array, have you tried setting depth to 0 or 2? wp_nav_menu( array( 'theme_location' => 'header-menu', 'container_class' => 'navigator', 'depth' => 2) ) Where 0 should be the default and allow unlimited submenu, and 2 would allow one submenu. I am not sure how this would happen, but if it works, perhaps ...


1

You can get the original sizes of the image being uploaded: list( $uploaded_width, $uploaded_height ) = getimagesize( $_FILES['u_img']['tmp_name'] ); Then you can use those values to size the image as you like: $height = 300; $image = wp_get_image_editor( $_FILES['u_img']['tmp_name'] ); $image->resize( $uploaded_width, $height, true );


0

first you need to create Theme options, here are some good example how to create theme options: https://codex.wordpress.org/Creating_Options_Pages http://www.sitepoint.com/wordpress-options-panel/ http://code.tutsplus.com/articles/how-to-create-a-better-wordpress-options-panel--net-9360 After successfully create your theme options, you will be able to ...


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

As @Michael says, header_image() returns the URL, you need to echo it: <img src="<?php echo esc_url( header_image() ) ?>" ...


0

So I resolved it by adding body{padding: 0!important; margin: 0!important}. Didn't know that something was overriding my *{padding: 0; margin: 0;}. Also, forgot to mention that the footer does not belong inside the wrapper which has a max-width of 1020px; because my psd file had the same width.


3

Your problem is your custom query. Do not use variables that is used by default by Wordpress. $posts and $post is Wordpress reserved global variables. Change $post to a unique variable, something like $posts_query. When using get_posts and you need to setup postdata to make use of template tags, you have no choiche but to use $post as setup_postdata() ...


0

Your css file clearly shows a max-width of 1020px it appears as if your zoomed out or just on a large screen from your screenshot. If your window is bigger then 1020px then obviously there would be white space on either side. .container{ width: 100%; max-width: 1020px; margin: auto; } Also important to note this is not a wordpress issue


-1

Can you please give this in css file to avoid spaces html, body { margin: 0; padding: 0; } Also yes the container is given max-width of 1020px.



Top 50 recent answers are included