Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [theme-development]

Themes create the public (front-end) interface for a WordPress site.

1
vote
1answer
67 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
1answer
41 views

Reason to add a name of the theme like ('menu-1' => __( 'Primary', 'twentynineteen' ),) in PHP?

Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in ...
0
votes
0answers
12 views

How to Select post parent for CPT from another post type?

I'm developing a Sports website, covering cricket football, etc. The goal is: .pk /cricket (Landing page) .pk /cricket/ipl (IPL Landing Page) .pk /cricket/ipl/year (IPL Landing Page by ...
0
votes
1answer
22 views

How to properly add and access a JavaScript file in Wordpress?

I intend to use a JavaScript library on my WP website and have uploaded the JS file via FTP to the following directory belonging to the currently activated theme Salient: /public_html/wp-content/...
-1
votes
1answer
24 views

Bootstrap isn't called into my Wordpress theme

I keep getting an error when I look into my page resource about my bootstrap.min.css file, which gives me a "Failed to load resource: the server responded with a status of 404 (Not Found)" => http://...
0
votes
0answers
19 views

REQUIRED: The theme uses the register_post_type() function, which is plugin-territory

I am developing a car rental theme, but I encountered a big problem, when I upload the theme I get the "REQUIRED: The theme uses the register_post_type() function, which is plugin-territory" the ...
0
votes
0answers
14 views

Theme's Java Script not updating

I' am trying to modify themes Java Script using Theme Editor. But when I click save, nothing happens on my page. I use WP super cache to clear my cache but it doesn't change a thing.
0
votes
1answer
12 views

More HTML elements variety in visual editor

Our HTML based website uses a lot of formats for styling text / pages. We're now transitioning to Wordpress so the our employees can also create and edit pages, but it seems like the Wordpress editor ...
0
votes
1answer
13 views

Redux Setting on custom created admin page

I am using Redux Framework and I am creating a theme and I want all my theme option on my custom created page Like this but by default Redux Created a different page like this I am using this ...
0
votes
0answers
9 views

Is it possible to remove original src from wp_calculate_image_srcset() results?

Was just wondering how one could load a custom srcset stack. I know the srcset loads all registered sizes so I'm good on that side but I cannot find a way to remove the original src from there without ...
7
votes
2answers
131 views

Upgrade from 5.0.4 to 5.1.1 causes $theme to be null

When we upgrade from 5.0.4 to 5.1.1 the site stops loading. The error message is Fatal error: Uncaught Error: Call to a member function images_path() on null /wp-content/themes/mytheme/header.php ...
0
votes
0answers
14 views

Why would you when building a theme want to recompile scss after wp-customizer changes?

I was told that when saving changes in wp-customizer in WordPress, it'll automatically update the CSS generated. I believed it was best to recompile SASS (using SCSS/PHP library) then compile CSS. ...
0
votes
0answers
20 views

Integrating e-commerce solution to my own developed theme

So I have developed my very own theme in WordPress for the first time. It was not really that hard until my customer wanted to add an e-commerce solution integrated on the site. The goal is to make a ...
0
votes
0answers
18 views

Data Validation & Sanitization for Big HTML Blocks

I'm developing a theme for Envato. Got Soft Reject because of issue typed in the question title. I created a 4 column widget area for my theme's footer. How can I sanitize the $output variable? Thank ...
0
votes
1answer
18 views

Wpautop in wp_editor not working

I recently added a custom meta box with Tinymce support. I wanted to output the data as html. If I code p tags manually inside Tinymce it works. But if I switch to Visual mode, the p tags aren't ...
1
vote
1answer
37 views

wp_editor() usage in custom meta box

i am building a custom meta box having a classic editor input rather than just input. The reason for using wp_editor is that I wanted to add paragraphs of text inside div but the simple input escaped ...
0
votes
1answer
30 views

Why does admin-ajax load slow and what are ways to speed it up?

I am developping a theme for wordpress which uses woocommerce. Currently I have developed a new page where I show the products. Initially I did the page and the filters for categories without using ...
0
votes
0answers
16 views

How can I not disable my theme when I want to upload a new version of it?

I am creating my own theme but I frequently make changes. When I try to upload a new version of the theme it sometimes ignores the changes or I sometimes get two themes or on the file system the theme ...
0
votes
0answers
14 views

Collapsible menu on post sidebar only expands and does not collapse

I'm working to improve an existing wordpress theme that was built for my organization. I've run into a problem that I'm not familiar with: the archive menu displayed on each post will only expand, but ...
0
votes
0answers
29 views

Three-tier menu? [closed]

The drop down menu in my theme is created with css and java in the style sheet. However I need it to be a three tier menu and am unable to get the coding right to make it appear to the side. Currently ...
0
votes
2answers
30 views

WP_QUERY wrong ammount of posts

I have 16 published posts of type "portfolio". With the query below, "found_posts" is 16. Correct so far. I've set "posts_per_page" to -1 to see all of them. But only 8 of them get rendered. The ...
0
votes
3answers
25 views

I have Wordpress setup on primary domain, how do I set it up on its subdomain using the same database?

I have a site www.domain.com with Wordpress installed. I need to create a subdomain for testing a new theme and have it linked to the main site's database. I have manually added the Wordpress files ...
1
vote
1answer
16 views

Default Permalink Type to Postname

I need my theme to default Permalink Type to Postname. Upon activation, my theme is executing the following code: //change permalinks to /%postname%/ global $wp_rewrite; //Write the rule ...
1
vote
0answers
16 views

How can I use $wp_query->tax_query as tax_query parameter for a new WP_Query instatiation?

I am trying to use $wp_query->tax_query right out of the box as tax_query parameter, however I cannot work this out. The parameters for my new WP_Query is actually the same as the default query of the ...
0
votes
0answers
44 views

Custom form in theme template displaying internal server error upon submission

I have a custom form in WordPress theme template but it is displaying internal server error upon submission. There is no error in error.log file regarding this submission. I am hosting my website on ...
-1
votes
1answer
28 views

Bootstrap 4 mobile menu not working for Wordpress Development

I have a custom bootstrap 4 theme I am building out in wordpress. The drop down mobile menu does not work when the hamburger menu is pressed at smaller viewports. I am not sure if I need to add a ...
0
votes
1answer
20 views

get_search_query() not working with search queries with ampersand in it

I am using plain simple code to make a search page $argscontactdirectory = array( "s" => get_search_query(), 'post_type' => array( 'expertarticle'), 'orderby'...
0
votes
0answers
13 views

Use custom field content in menu-item

I'm making a mega-menu with some menu-items that can have a more rich content (from a wysiwyg editor using ACF custom fields). So, i have set an ACF field group to work with menu items, i need that ...
0
votes
1answer
21 views

Woocommerce singe product custom gallery output works just on the first slide

I copied the "product-image.php" to my theme folder in order to change the HTML output a bit, so instead of using wc_get_gallery_image_html I created my function and changed the output there. Here's ...
1
vote
1answer
10 views

Highlight “Show all” item in wp_list_categories

I use wp_list_categories to display category filters on post archives. I can use current_category param to set current category - and such item will get addition class current-cat. I can even omit ...
0
votes
1answer
27 views

Theme development - Automatically menu creation

I've been working for a couple of days with automatic creation of menu upon theme activation in wordpress. I've achieved the creation of menu and it's working as expected, except i want to add sub ...
0
votes
1answer
14 views

How to show metabox on page if it is using a template

I was creating metaboxes for a special kind of pages. But i got stuck when showing metaboxes to the pages only who currently have the template 'Sky'. my template file name is sky-template.php and ...
0
votes
0answers
16 views

Mix it up & Wordpress

I'm trying to create a MixItUp of articles. Those articles are in my category "Projet" which as 5 sub-categories. My problem is that I can't sort them with my sub-cat controls. If someone can explain ...
0
votes
1answer
14 views

Displaying the right content on a page url

I created a WordPress theme with one page design format which means I wrote all the code in the main index.php file. Now I need to make a different page with separate URL but for some reason it still ...
0
votes
1answer
18 views

Replace Home with image link inside custom header menu

What I want to achieve is a header menu like this: Right now, I have this: I am not far off. To get to where I am currently at, I followed these instructions and added some custom CSS. So I added ...
0
votes
1answer
33 views

Is_single not working properly in genesis

I am currently creating a child theme for my website which uses Genesis as a parent theme. Now I am making single pages as per my choosing. So, I am removing the entry header from within HTML main and ...
0
votes
0answers
50 views

How to offset main query without affecting other queries and backend

I'm trying to offset my main blog query by 3 posts whilst trying to get the pagination to function correctly. I've been following the codex reference here but I'm struggling to get it working as I ...
0
votes
1answer
29 views

Multiple content areas with Gutenberg - Transparent areas mid content

I am trying to find a solution to a layout I have been tasked to build using 'Gutenberg' blocks. As far as I am aware there can only be one the_content(); per page. The layout I am trying to achieve ...
0
votes
1answer
29 views

Fix hover images blink

I have this css script generated using php, it's used to show a wordpress second featured image when an user hover. The problem is that the images are blinking and I don't know how to solve this small ...
0
votes
1answer
18 views

Comment status shows 'closed' in db, but it shows 'open' when i echo it

Here is database ss. And comment_status is closed But when i print it, it shows open echo $post->comment_status; Also, in page settings, comments checkbox is unchecked. So, i can't hide ...
0
votes
0answers
10 views

Style Wp-admin similar to Frontend

I use a really modern and materialistic theme for my frontend, but the backend is not that good looking. My clients often visit backend and i want uniformity in styles and color scheme, like button ...
0
votes
1answer
17 views

How to unset a set query variable?

My theme file, multiple times over, passes sets a variable to a template part used in a subsequent template part file via set_query_var, like so... set_query_var('feature_id', array(143866)); ...
1
vote
1answer
31 views

Using a variable in is_page(array())

Similarly to this topic I need to extract some page IDs from user input (a theme options admin page), store them in a variable, and then filter using the is_page() filter. The input consists of ...
0
votes
1answer
35 views

Moved a website and excerpts don't work for old posts

I moved a WordPress website to a different host and all post excerpts stopped working in the blog list. When I make a new post they appear fine but doesn't show for the old posts. I peaked into the ...
0
votes
1answer
15 views

How to get full native language instead of iso?

I am not using WPML or Polylang, but multisite to create multiple languages. The code below is used to make a language switcher, but I want a second menu with the full language name for a different ...
7
votes
1answer
51 views

Proper, exhaustive documentation for wp.editor etc

There exist the following : wp.editor.PanelColorSettings wp.editor.InspectorControls wp.editor.RichText wp.editor.BlockControls etc. Where is the documentation that shows the full list of available '...
0
votes
0answers
17 views

Create custom role and capabilities to manage CPT

I have created a job offers plugin with two custom post types job_offer and job_application. Now I'm trying to create a custom user role "HR Manager" with custom capabilities. This user role should ...
0
votes
0answers
10 views

I want to add plugin files in wordpress theme directory

I added a few lines code in plugin. I want to add that plugins file in wordpress theme to avoid to be overwritten when there is an update. How can I do this?
0
votes
0answers
13 views

How to show users with have role in separate menus in wordpress admin panel

In users menu Wordpress admin panel, for default shows all users with all roles in a menu. I want to show users with have role in separate menus in wordpress admin panel. For example each users have ...
0
votes
2answers
34 views

Multiple do_shortcode($content) within one shortcode

TLDR; How can I run a shortcode with multiple shortcodes inside of it? I'm trying to run a shortcode with multiple shortcodes inside of it. I can successfully run a shortcode with one shortcode ...