Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,453
questions
1
vote
2
answers
874
views
How to implement a $_SESSION alternative in Wordpress inside a theme without a plugin?
I want to show a popup to the first time visitor of a Wordpress site. I tried to check the visit state using $_SESSION. Something like this in the footer.php:
<?php
if(!isset($_SESSION['pxpop']))
...
0
votes
1
answer
1k
views
Can't display posts by filtering categories using isotope.js
I am currently building a wordpress theme using the isotope.js script which allows you to display articles on the same step by filtering their categories, I struggled a lot and I still can't get the ...
0
votes
1
answer
1k
views
Add multiple sections, settings and controls at once to the Customizer
I am trying to make a slider configurable via the customizer. In order to let the user decide how many sliders he wants, I added a setting where the user can enter a number.
Based on this number I ...
1
vote
1
answer
720
views
Two queries on the same page with pagination
I’m trying to put two queries on the same page with pagination. But the pagination of one interferes in the other. How can I do this with two independent pagination
<div class="row list-group">
...
0
votes
0
answers
19
views
Pagination Links for Custom post type returns 404 [duplicate]
first of all, I am new to WP development, and PHP.
I am developing a template that has several custom post types. the problem is when I add pagination to my custom post type, all pagination links ...
0
votes
1
answer
2k
views
Importing sass into underscores theme
I am developing a new theme using Underscores. I am starting the process of migrating in the code from the already built site in html/css. I built it using .scss files and am not sure where to copy ...
0
votes
1
answer
1k
views
Theme option page doesn't save options
I am trying to practice adding theme options page using settings API but unfortunately the code i have written according to the codex doesn't work properly. When i tested the code no errors generated ...
1
vote
1
answer
1k
views
How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like
now I have like 150 rows CSV formatted ...
0
votes
0
answers
16
views
Can not edit Wordpress preset CSS-classes in own Theme
Good morning,
I'm making my own (classic) theme for the first time. After I installed the test XML data, I noticed that some things weren't displayed correctly. For example, H1-H6 are assigned the CSS ...
1
vote
1
answer
1k
views
How to set the currently active page in the menu including parents
I have the following problem:
There is a custom post type. There are several pages each listing some of the posts based on some post criteria (custom WP_Query).
When I click on a link to open the ...
0
votes
1
answer
673
views
How can I find related learndash course id from woocommerce product object?
I have woocommerce integrated with LearnDash. Now I am trying to get the selected course (related course) from the woocommerce product object or any other way (by woocommerce product id). There must ...
0
votes
0
answers
4
views
Create multiple facades for same product?
Consider you sell zucchinis (courgette for those British, French).
And that is exactly my problem.
If I make a product called Zucchini - then it'll list on Google as Zucchini. But then I will not get ...
1
vote
1
answer
1k
views
Wordpress shows error related to allow_url_fopen
I just installed wordpress with plugins, everything works find except on a 'contact me' page, where I can see an error like this.
Warning: getimagesize(): php_network_getaddresses: getaddrinfo
...
0
votes
2
answers
6k
views
How to output wp_enqueue_style() in HTML head instead of footer
I added some actions to wp_enqueue_scripts to load my custom css and js files in the header section by using wp_head(); right before the closing </head> tag.
function mytheme_scripts(){
// ...
0
votes
2
answers
1k
views
have_posts() return false on single post
I'm a little bit confused with the use of the Loop. This is my first theme and i just use index.php currently to display all my pages. It works fine for pages but have_posts return false when i try to ...
1
vote
2
answers
1k
views
wp_script_add_data doesn't seem to work
I have tried following the codex following various threads here, simple, copy-paste various examples but to no avail. It just doesn't work.
Has it been depreciated? Has anyone got this to work in any ...
6
votes
2
answers
5k
views
Update Multiple Post Meta for the Same Post In One call?
How can I update multiple fields/Custom fields for the same post using only one call?
Everything I came across are cases of multiple calls of "update_post_meta", for each of the fields.
Is ...
0
votes
0
answers
24
views
old content are still displaying after using wp reset and clear cache
i have only two files in public_html folder, but when i opened the website link in private window, site old content is still displaying ? what i need to do to remove old site content ?
index.php :
...
0
votes
1
answer
711
views
How to display only child category post in related posts in custom post type?
I'm trying to display only those posts which are under the same category of the post which I have clicked as related posts. My custom taxonomy are like this :
Fsc year 1 => Biology => Bio chapter 1 . ...
0
votes
1
answer
25
views
Bring your own theme to PHP 8
My self-created theme no longer works under PHP 8. I would like to change it so that it continues to work. Currently only the navigation is displayed.
I have deactivated all plugins.
I have tried to ...
0
votes
1
answer
21
views
Show posts assigned to multiple categories in current category page
Whenever I assign a post to multiple categories, the Wordpress website just loads posts from Cat1 only. No error message.
My post-assignment method:
Post1 - Cat1
Post2 - Cat2
Post3 - Cat1,Cat3,Cat4
...
0
votes
1
answer
9
views
Show category name in category.php when posts assigned to multiple categories
I'm trying to show the category name in my category.php but it's not working when I have posts assigned to multiple categories as it chooses the first category.
<h1><?php $cat = ...
0
votes
2
answers
2k
views
Need help with adding custom wordpress menu and sub-menu
I've got my HTML Custom Nav set up and it works fine for static template. I want to convert it into wordpress navigation menu. I am totally new to wordpress and i want help to convert html menu to ...
1
vote
1
answer
213
views
How can I ping update-core.php with a script?
I have the paid Divi theme on many websites on a cPanel powered server. I use WP-CLI in a bash script to update all the plugins and themes. But Divi will never update because it only reveals an ...
0
votes
1
answer
1k
views
Display content on Single page
I am building a single page theme, And I am having a problem with get_post_meta()
The Problem
This code bellow does not work, and I cannot see anything on the website as it's blank. Here is my index....
0
votes
2
answers
2k
views
How to disable controls in theme customizer?
Edit: I have rewritten the question in hopes I will get a reply from someone who knows the theme customizer.
I am trying to figure out how to disable setting controls in the Wordpress theme ...
5
votes
3
answers
12k
views
Call to undefined function get_current_screen() on my localhost
I'm using Wordpress 3.9.1 and I get the
Fatal error: Call to undefined function get_current_screen()
if I put the following in my funcitons.php or in any file of my theme:
$screen = ...
0
votes
1
answer
1k
views
How to use posts as tabs in a custom page?
everyone. I'm a beginner at coding/Wordpress and need some help with a custom page I'm developing right now. The idea is simple:
A list of items on the left
An image with a description below on the ...
2
votes
1
answer
1k
views
How can I get full attachment url from wp_get_attachment_metadata?
I want to get all sizes of an attachment. I can use wp_get_attachment_metadata to do this. But it only return filenames, not file urls.
How can I do this?
This is a workaround, but doesn't take ...
0
votes
1
answer
29
views
Why does customize_register only load inside of functions.php for me?
I'd like to better understand - when I place the below into my functions.php file:
add_action('customize_register', 'boat_annualReport_customize_register');
function ...
3
votes
2
answers
1k
views
Cache Busting using htaccess Rewrite rule?
I am trying to follow this tutorial that says i can make a server to send a file like style.css if the requested file is style.15458888.css with a rewrite rule to be put inside the htaccess file.
...
1
vote
1
answer
1k
views
Using WordPress' Theme Customizer to select page templates that update layout in the preview
I wasn't sure where to post this question..
I recently discovered WordPress' "Theme Customizer" and am using it to make the pages easier to update for clients. Rather than the standard way of editing ...
1
vote
1
answer
738
views
Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
<?php
/**
* Template Name:Zoho testAPI
*
*
*
*
*/
echo phpinfo();
?>
0
votes
1
answer
879
views
Fatal error: Class WP_Customize_Image_Control not found
I'm using WAMP on Windows 8.1 64 bits to develop a custom theme.
Right now, I'm getting the following errors when trying to create a custom control with the WP_Customize_Image_Control class:
Fatal ...
0
votes
1
answer
2k
views
Woocommerce Theme Reviews / Comments
Ok so i'm creating a Wordpress theme and i'm at the point where i'm trying to get a list of the reviews but the default comments_template() HTML isn't how I need it.
I don't have a /comments.php ...
0
votes
1
answer
798
views
How can I set multi archive page template on same time for only one custom post type?
I want to show templates of my theme to promotion.So, I need show different templates for only one custom post type.For example, on header menu, if click template 1 button, will show the archive with ...
0
votes
1
answer
14
views
Selective styles and scripts inclusion
I'd like to know if is there any method that allows to include scripts on specific pages/templates depending if those page have a specific get_template_part inside.
Example:
I have more than one page ...
0
votes
2
answers
2k
views
creating a custom post template
I want to customize my individual posts. I have an example of what I'm trying to achieve below. Would I make a custom post template for this? If so how would I do this? Or should I add to my single....
0
votes
1
answer
1k
views
How to load mediaelement.js in theme template?
I'm developing a video oriented theme. I need to include native WordPress video player in my page template. This is what I'm doing:
$video url comes from a custom field. It outputs the video file url ...
0
votes
1
answer
709
views
Filter URL and shortcodes from the_excerpt
I just noticed a weird behavior on a theme I'm working on. If I have a post with just one link or shortcode, the_excerpt will print that URL or shortcode. But if I have some text in the post, below or ...
0
votes
2
answers
1k
views
change background image on scroll
I want to create a background image effect that will change the image when the user scroll. I'm facing a problem with the images urls, how i can fix this? How I can link an image url in jquery from a ...
2
votes
0
answers
39
views
Adding block style dependencies
I'm running into a problem where my block styles are being enqueued before my theme style. Because of this, the theme style is overriding my blocks and that is undesirable.
Is it possible to add style ...
1
vote
1
answer
3k
views
Divi - How can we show background video on mobile
By default, Divi theme forcibly stops background videos from ever displaying on mobile devices. Is there a way around this, even if not all devices are supported, at least to show the mp4/webm to the ...
0
votes
0
answers
21
views
404 error on page reload
I have created a WordPress based web app that will rely on template pages that will host some vue.js different front-end apps. I've added this code to the theme functions file to rewrite all the ...
0
votes
1
answer
13
views
Is child-theme required when modyfing "Appearence > Editor"?
I'm using the block theme "Twenty Twenty-Three" and I've modified its appearance by doing some custom editions through "Appearence > Editor".
Now, will I lose all those changes ...
0
votes
0
answers
19
views
Confusion about theme's parent and child functions.php file
So I read WordPress documentation here:
https://developer.wordpress.org/themes/basics/theme-functions/
Where there's such statement:
Although the child theme’s functions.php is loaded by WordPress ...
0
votes
1
answer
17
views
Custom post type 404 category page
I created a custom post type called news and a taxonomy for the custom post type called news categories. However, the category page archive returns me 404.
**Register Custom Post Type**
$...
1
vote
1
answer
746
views
Password field is empty when using wp_signon();
I'm trying to make a custom login action for my custom login page. Registration page with custom user meta works fine, but the problem with login page is that everything should work, but it doesn't ...
0
votes
1
answer
1k
views
CSS loading as empty file in Custom Theme
Hello I made a custom theme and moved it from MAMP to a cloud server. For some reason the CSS is an empty file. File path is correct, checked the file in cPanel and it has the full .css sheet. But ...
2
votes
1
answer
2k
views
front-page.php is not Listing in Static Front Page List
I have a in my theme directory and I would like to set the WP to be static based on page. I didnt create any pages so far because my assumption was the must be listed as a page in the front page ...