Stack Exchange Network

Stack Exchange network consists of 174 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

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

0
votes
0answers
20 views

How do I left justify top menu in 2017 theme

It’s not a theme customization menu option. Can’t find it in the css file either. Can anyone help or point me in the right direction
0
votes
1answer
21 views

Where i should not use if (!defined('ABSPATH')) { exit; }?

I think this best way to prevent direct access.. <?php if (!defined('ABSPATH')) { exit; }?> i have used this on all my php files..can it create problems? any files on WordPress theme i should ...
1
vote
2answers
71 views

How to Globally Use wp_localize_script() Ajax URL

I have added this to my functions.php and need to use ajaxURL in all of enqueued scripts in the template (instead of enqueuing only one script here add_action( 'wp_enqueue_scripts', '...
0
votes
0answers
22 views

Which cache is kicking

I have been struggling with a site that I inherited from another developer. My main problem is that, changes I make in the css file of the template don't get picked up right away, indicating that ...
0
votes
0answers
9 views

wp_nav_menu() filter - preg_replace value returned wrong

I'm having an issue where the filter I've added to wp_nav_menu() is adding code to the second level of the navigation. How can I change the filter or the preg_replace code in a way that only adds it ...
0
votes
1answer
14 views

How to display latest posts with authors image

how can U get latest posts from a specific category and post them with the picture of the author. All authors are signed as an author on WordPress and they all have profile picture. Actually it will ...
0
votes
0answers
22 views

WordPress panel is not loading after plugin activated with error: HTTP ERROR 500

when i try to activate Yoast Seo Plugin, my WordPress panel stop loading and the browser displays: HTTP ERROR 500. I checked my error_log file and there was this error: call_user_func_array() expects ...
0
votes
0answers
8 views

Different WP Rest API custom endpoints across different themes

I have created a custom theme on Wordpress with custom WP Rest API endpoints. This is how I have set it up. Theme name: Theme 1 Added below line in functions.php require get_parent_theme_file_path( ...
0
votes
0answers
20 views

What is the recommended way to save errors / warnings / user messages from actions / filters for custom display in the frontend?

This is a very basic question and there are a lot of solutions to it - however what is the recommended (or at least a good) way? Problem statement: While processing a request to a WordPress project ...
0
votes
2answers
21 views

How to make animated intro?

There are a few websites that I stumble upon now and then that have animated intros like the one here: www.monotwo.com How do I do that in WordPress? And how would I integrate this into a customs ...
1
vote
0answers
18 views

Adding custom class to get_avatar() image doesn't work

Instead of outputting <img alt="" src="#" srcset="#" class="avatar avatar-60 photo" height="60" width="60"> I want to add custom class which looks like <img alt="" src="#" srcset="#" class=...
0
votes
0answers
15 views

My page got to many DOM elements (still loading fast though)

So we are building a new webshop on the Wordpress/WC platform and we bought a theme on the Envato Market. I am trying to optimize all of the things at this moment and we are getting some pretty ok ...
0
votes
1answer
25 views

Menu is in Reversed order

I cannot seem to figure out why this menu is in reversed order only for Mobile. site-navbar.php <div class="menu-container"> <div class="menu w-full mx-auto container xl:pr-16"> ...
0
votes
1answer
11 views

How to set different localization file for different users?

I am trying to load localization file depends on users settings. Is this way is correct or there are better ways to implement locale changing depends on user settings? <?php ...
0
votes
0answers
9 views

Add tax status to products in header mini cart (woocommerce/storefront)

I have a site running woocommerce with a storefront child theme, and I need to add the tax status of each individual product as a class in the html within the header mini cart. I figured there must ...
1
vote
1answer
27 views

Same ACF on two different pages

I've made quite an extensive page.php using ACF-repeaters and the flexible content module (1000+ lines of code). The code is getting really spaghetti-like, and I'm not sure how to structure it so it's ...
0
votes
0answers
25 views

How to replace a specific element from a link? [closed]

For example, I want to change the title="apple" to data-title="apple" inside a link. And just replace that for a specif div instead of all div in a page. Namely from <div class="fruit"> ...
0
votes
0answers
13 views

Integrate HTML/CSS editor for website visitor

I want to integrate HTML/CSS editor for my WordPress website. So that when a visitor read my blog he/she can practice in that HTML/CSS editor. Check this sample link. How can i do that? Thanks
0
votes
0answers
14 views

Add wrapper for a specific sub-menu

I am trying to add a wrapping div around a specific sub-menu. what is the best way to do it ? is there a way to target the sub-menu and modify it or should i just use 'wp_nav_menu' or '...
0
votes
1answer
22 views

How to test another theme in a live WordPress website instead of live preview?

I want to implement a new theme called Hepta on my current website, but when I test it using the live preview, it shows me limited content and features as it imports most of the contents from the ...
1
vote
1answer
18 views

Catagories to the list of the titles in that catagory to the content of the post [closed]

Wordpress homepage is shown. On the left sidebar catagories are shown. When the user clicks the category the post title related to that clicked category is populated on the middle part. Now when the ...
0
votes
1answer
16 views

How to display only the first two elements from ten same elements

For example, in my theme, I have the following elements, <ul> <li> apple </li> <li> orange </li> <li> banana </li> <li> pear </li> <li> ...
0
votes
0answers
21 views

Remove woocommerce actions for frontpage

basically i want to remove the default single product actions that woocommerce uses but only on the front page. To attempt this I first just removed the actions like so: // woocommerce hooks for ...
0
votes
1answer
13 views

How to get current post user id

I have some posts, each post have different authors(users). I save each author image avatar in user_meta table. Now i want show each author avatar in self posts. i get user_id with ...
0
votes
0answers
28 views

Modify core files to display products by category

I'm pulling my hair over here searching and trying to modify the WooCommerce core files. So, what I am trying to do is modify my theme's woocommerce.php file because I want to display the products ...
0
votes
1answer
19 views

When the user entered an unauthorized url redirect to login page

I have custom account page for user, i want the users who are not logged in site when enter http://example.com/account redirected to a custom login page. Here My code function setup_user_panel_url()...
0
votes
0answers
11 views

Create customization options using theme customizer API based on the number of top level menu items

I am creating options for my theme, to customize and style menu items trough theme customizer. Each menu item will have its own options to change icon next to it and color. As I don't know how much ...
0
votes
0answers
22 views

Add meta data in head from theme

I want to add a meta data in the head of my website. I have a post type with custom template : single-custom.php In this template, I want to add this meta : <meta name="robots" content="noindex"&...
0
votes
0answers
15 views

jQuery code not working with theme

So im working on a site, a custom wp theme with a _s boilerplate, i've enqueue my styles and scripts which the browser picks up fine no errors; wp_enqueue_style( 'bootstrap-css', 'https://maxcdn....
-1
votes
0answers
21 views

How to hide wordpress details being shown to browser developer options? [duplicate]

Is there any way to hide the theme and plugin details that's being displayed in browser - source tab in browser developer options?. Hiding the wordpress identity?
0
votes
0answers
9 views

Assign multiple user created menus to one theme location

I know what I am asking is probably out of the scope of Wordpress's ability but anyway. My issue is that I need to assign multiple menus to a single theme location (the dynamic location), I have set ...
0
votes
2answers
32 views

Is hand coding required at all?

With template builders like Divi and Elementor, is hand coding still required? We are building a B2B website on WordPress and there are no transactions involved in it. Our content will vary from page ...
0
votes
0answers
14 views

Losing alt attribute after image crop

I have added theme support for custom-header, and i want to display it in the header of the front-page by using the get_header_image_tag() function, which works pretty well and receives an optional ...
0
votes
1answer
29 views

WebP Fallback for Inline Background Image in Style Attribute

I have developed a theme which has a custom post type called projects. On single project pages there is a parallax style section with a high quality scrolling background image. I am using a custom ...
4
votes
2answers
90 views

enqueue script for specific shortcode

I've created some shortcodes and for some of these, I need to load particular scripts on demand. I've included by default in my function.php file vendor.js myscript.js When i load the shortcode, i ...
1
vote
1answer
26 views

How developed with version control word press site on shared host? [on hold]

I have web site online now I want to connect it with version control. It deploy on shared host. Because When change online it effect the site I want try local and deploy changes. I downloaded all ...
1
vote
1answer
27 views

Use debugging for add action events

Is it possible to vardump the variable inside the action function? i am not able to echo or see results when i am doing so. This is not a woo commerce question but i am having problems with ...
0
votes
2answers
26 views

I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php

I am actually building a custom theme for my blog and I use single quotes for HTML everywhere like: <div class='div'></div> Does this cause me redirection to index.php?? My site ...
0
votes
2answers
17 views

Control the srcset much more (not all sizes in it each time)

I'd like to be have more control on the srcset on certain important images of my website if not all. By default the srcset includes all the sizes created by wordpress for all the images. I'd like to ...
0
votes
0answers
29 views

Problem with Mobile navigation menu with wp_nav_menu() function in WordPress

Here is the problem. I'm creating a theme in WordPress and I have trouble with dinamic navigation menu on Mobile devices. Here is the code which I use: <nav id="primary-menu" class="navbar navbar-...
0
votes
1answer
16 views

Custom Search form not working in localhost

This was the solution that i got from @Ray Gulick for having a custom search form for custom post type. This works fine in hosting service but fails in localhost as the form action is added as action=...
0
votes
1answer
25 views

How to display author meta and count numbers for each user in comment.php?

All users are registered to comment on the site, so what I want to achieve is, to display user details like the meta info, description, url, etc... So, if possible also the number of posts and ...
0
votes
1answer
22 views

what is `get_section()` and how to use it?

i saw get_section() being used in WordPress. what is this function and how can i utilize it for theme development?
0
votes
0answers
24 views

How do I safely separate a custom portfolio type that was developed inside a theme?

I am working on a website that is using the theme Nordic. I am preparing to develop a new template for this website, but I have a problem: the entire content of the site was created on a custom ...
1
vote
1answer
12 views

How to add styles set by user in the customizer

I want my theme to be very customizable, and so far i have provided the possibility to change text and link colors to the body, plus the background color which comes by default (I'm using the ...
1
vote
1answer
34 views

How to get data about category in category.php

I have to make custom category.php template, but how do I get data about category in category.php? I need these: Category name and id Category's parent name and id All category's items Let's say our ...
1
vote
1answer
28 views

Custom get_the_excerpt() only works on first post

I use a custom get_the_excerpt function in my theme. It works perfectly for the first post in the loop, but the other posts are using the standard excerpt function. I do not understand why? The ...
0
votes
0answers
32 views

Remove action added in plugin class from theme

I am trying to remove action that is added via plugin in my theme. The below plugin class creates a portfolio page template but I don't want this page template in my theme. Is there any way to unhook ...
0
votes
1answer
42 views

Remove Pagination for Product Category Pages WooCommerce

I am trying to remove the pagination for product category pages when selected. There are currently 9 products per page for any given category. I manipulated the way WooCommerce displays products to ...
0
votes
0answers
33 views

Skip Privacy Page settings at installation

We have a custom theme installation system that redirects to an options page after installation. In this page we have an privacy policy generator. The issue is that after the recent privacy policy ...