Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

Custom theme on multisite has issues with standard loop output

I am experiencing the following error output when using the standard loop on page.php and single.php on a multisite-based WordPress installation. The loops are the same for both template types, with ...
Mike Hermary's user avatar
1 vote
1 answer
185 views

Wordpress post-template null warnings

I am getting these PHP8.0 Warnings from my WordPress site. The warnings are pointing to core code, not anything custom. When I turn debugging on there are no error messages on the site. I also checked ...
Dawn's user avatar
  • 43
0 votes
0 answers
976 views

PHP warning $post->ID is null

I've been having some difficulty with the following error, and my PHP skills are pretty non-existent. Whenever I try to create a new page, I get the following error: PHP Warning: Attempt to read ...
Joseph Yang's user avatar
0 votes
0 answers
44 views

Page not visible in 'All pages' after being added through PHP

I'm adding some pages pragmatically as a subpage. This all works well on a test website in 1 locale. However, on the live website we have WPML with 2 locales. When adding them there, these pages DO ...
Peps's user avatar
  • 53
0 votes
1 answer
367 views

Automatically add images to a menu

I am calling a menu into a page, but I want to add images next to the title of the menu items. I have this code: <ol> <?php $navMenu = wp_get_nav_menu_items(2096); /*/Pass Nav Menu_id or ...
vyperlook's user avatar
  • 177
0 votes
1 answer
70 views

Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)

I installed latest XAMPP & extracted latest WordPress to this path: C:\xampp\htdocs I activated default theme: Active: Twenty Twenty I created these: 1 Page called test: http://localhost:82/...
compliance's user avatar
0 votes
0 answers
17 views

My worpress search page is showing no results

I want to display the publications searched for via searchform.php in the search.php page but it does not work ... The search is done well when I look at the url (ex: New World): http://localhost/?...
Maximus's user avatar
0 votes
1 answer
327 views

A function to get the content of a page

I have an Elementor page and I need to get the HTML and CSS output of it without the header and footer to use in an email plugin I am making. Is there a function in WordPress that can do this? I've ...
Maytha8's user avatar
  • 121
0 votes
1 answer
781 views

How can I check if a post with a particular slug or title exists?

I want to know if a particular page exists. I'd like to check against either it's slug or it's title. There is a function called 'post_exists'. But this function seems to only work if it's invoked in ...
bob.dobbs's user avatar
  • 113
0 votes
0 answers
51 views

When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php

When I click on a link to redirect to 'single_assignment_page.php' it is not showing the content of this page but it is showing the content of 'index.php'. That's something I don't want but in the URL ...
Jakub's user avatar
  • 1
0 votes
1 answer
2k views

How to check if the current page is at a specified path in the URL?

I have a page marked as the Posts page that lists most recent blog posts. It is at path /blog. I want to know when the user is on this page so that I can display a list of categories of blog posts at ...
silviubogan's user avatar
0 votes
1 answer
28 views

Category Page Displaying all Pages

My page here: https://blackfreedom.proquest.com/category/civil-rights-and-black-power-movements/activism/selma-demonstrations-and-marches/ is displaying all pages on the site, not just the ones that ...
Joe Kalucki's user avatar
1 vote
1 answer
405 views

page-slug.php not working but only for specific slug

I'm trying to create a page called "Comics" with the slug "comics" to use as the main table of contents for my webcomic site. I've created a page-comics.php file, however when I ...
ZackAkai's user avatar
1 vote
1 answer
99 views

syntax issue on php 7.4

I have a syntex issue on my WordPress platform since I tried to put php version on 7.4. WordPress sent me automated email with the error below : Error Details An error of type E_PARSE was caused in ...
Samuel's user avatar
  • 354
0 votes
1 answer
3k views

Need php code's output to display underneath a Divi Module

I have functional php code for a page which creates a table. To get the table to display on the front end, I used a Page Template (see code) to create the page (in Page Attributes), rather than using ...
clg's user avatar
  • 3
0 votes
2 answers
1k views

Insert page content into another page with a changed variable

I'm trying to use this simple code to insert page (1) content into another page (2): <?php $id = 216; $p = get_page($id); echo apply_filters('the_content', $p->post_content); ?> So far so ...
Kristýna Šulcová's user avatar
1 vote
1 answer
2k views

How do I publish only one page to production after making changes on staging?

Is it possible to push only one view to production? For example. I made a change on view A a while back on staging and it's just been sitting in staging. Later on, I'm asked to make a change on ...
testman's user avatar
  • 11
0 votes
1 answer
134 views

Split post or page content in two or more columns

I'm not using a pagebuilder, this because I like to offer to any client a different layout for the contents. I have the necessity to split the contant of a page or post in two or more columns, I'm ...
sialfa's user avatar
  • 329
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 ...
ren's user avatar
  • 1
1 vote
2 answers
2k views

Insert a button on a page with random number generation

I want to add a button on my wordpress page. When the user click on it, the text box above that button show a random number between 1-10000 I am quite new to Wordpress, I want to integrate some ...
gudako's user avatar
  • 111
1 vote
4 answers
3k views

Add a Different CSS Class Into The Body Tag of Different WP Pages

I'm transferring a 20 page static HTML site to a custom Wordpress Theme. On each page of the static site the body tag has a custom CSS class i.e. 'banking-page'. I know that WP generates page id ...
pjk_ok's user avatar
  • 908
0 votes
1 answer
249 views

Display page content in different sections - based on page break block?

Is there a way to loop through page content, and display the content that is above page break in one section, and everything that is below the page break in another? Or additionally, a way to generate ...
Rafał Jara's user avatar
4 votes
2 answers
1k views

How to check if feed URL was requested?

I'm writing a plugin to block some pages to anonymous users on my site. I already blocked some pages but I can't get to identify the feed page my-wordpress-site.com/feed. I've tried: $GLOBALS['...
Rafael Carneiro de Moraes's user avatar
0 votes
1 answer
27 views

Do not show child pages within a file page

I have a CPT created, in my CPT file page the father pages and daughter pages are shown. Books of science Book 1 Book 2 Books of science fiction Book 1 Book 2 In my case I don't want it to ...
Marifer Villarroel's user avatar
0 votes
1 answer
172 views

Disable Sidebar on certain pages

Good day! How do you disable/remove sidebars in certain pages? Do I need to install a plugin(what plugin)? Or should I do a custom code? Thanks.
marvin castro's user avatar
0 votes
0 answers
392 views

Failed to load resource: the server responded with a status of 500 () post.php

I got no error in my Admin panel but when I define a new editor or author role when the user goes the panel to edit or add new page nothing works, no button, no page builder and nothing and He got ...
zEn feeLo's user avatar
  • 207
-1 votes
1 answer
59 views

Forbid certain users to access a specific page

I want to build a blog where every user is allowed to post something (only text) after a successful registration. However, a user should only access other contributions from users who have uploaded at ...
noah's user avatar
  • 1
0 votes
1 answer
540 views

Child and Parent Pages list of sub pages

I have a parent page called services with children, each service child has child pages within it. On the first level child page i want to show all of the pages below it in. When i click through to ...
reigns1989's user avatar
0 votes
2 answers
261 views

Static Page with php echo [duplicate]

I build a static page in my WordPress root folder. Now I'm trying to include a list of my categories with echo clpr_categories_list();. Its not working because I some how have to tell the static page ...
joloshop's user avatar
1 vote
4 answers
2k views

How can the plugin directory path be returned into <script> </script>?

How can the plugin directory path be returned into <script> </script> instead of hard coding the path? Here is the custom-page.php: <?php get_header(); ?> <script type="text/...
65535's user avatar
  • 135
0 votes
2 answers
2k views

ACF: Echo page title when checkbox is checked

How can I show the title when a checkbox is checked. I use Advanced custom fields my field name is nav This is what i currently have. <?php if(get_field('nav')) { ?> <li> <a href=...
Gago's user avatar
  • 11
0 votes
2 answers
347 views

How to echo every parent page title?

I have like 5 parent pages and would like to echo all their title's on the front page.php. Maybe with get_the_id(); but don't know how.
Gago's user avatar
  • 11
0 votes
1 answer
750 views

How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]

Good Afternoon, I am having difficulty removing a duplicate H1 tag, which is located in my Site-Title-Wrapper, per source code. When I access "Edit Theme" and load the "site-title.php" I can see the ...
OptimizedValue's user avatar
0 votes
1 answer
2k views

Inject class in body when particular page template is used

<body <?php body_class(); ?> > In header.php I have written the above code. But I want when this page template is in use: page-customer.php then body_customer class should go above. ...
WordCent's user avatar
  • 1,877
0 votes
2 answers
3k views

Python in Wordpress - A "Hello World" implementation

I've read this question (and many more web pages) in order to figure out how to run a simple python script via a Wordpress plugin. However, I couldn't do it: I always get a "Blank" output. No errors ...
nickh's user avatar
  • 105
1 vote
1 answer
2k views

Can't get page content in WordPress

When I use the the_content() on page-about-us I can't get the content of the about us page from WordPress. I got only below warning Warning: count(): Parameter must be an array or an object that ...
user avatar
1 vote
1 answer
535 views

Way to querry data (tags) from a wordpress database?

I need to query the WordPress database and display the data on one of my pages. I've looked and search for tutorials online but none of them are really complete. I am trying to display a list of all ...
answerSeeker's user avatar
0 votes
1 answer
151 views

How to tell if a page has subpages for Custom Post Types

I would like to show a page depending on whether it has a subpage or not. That is, if you have subpages, do not display the subpages, only the parent page to which it belongs. Something like this: ...
Marifer Villarroel's user avatar
0 votes
2 answers
6k views

loading a php file to a specific page id

I'm trying to assign a php file to a specfic page? I have modals stored in different files and want have them load in when their assigned page is called. These pages are using the same theme, "...
David Sanchez's user avatar
0 votes
2 answers
1k views

Getting page / post URL on publish and / or update

I am trying to use a simple publish_post / publish_page hook to get the URL of the post/page when it is either published or updated so I can later turn it into a static page. Is it possible to add ...
Devin Rowan's user avatar
1 vote
1 answer
252 views

Custom Template 404 for specific custom post type

Some solution to create a custom template for (page 404) for specific custom post type.
Juan David's user avatar
-1 votes
1 answer
43 views

How to return a Boolean for a page that is a subpage thru its name?

I am attempting to check for a page that is a subpage using its name. For example https://www.myexample.com/mypage/subpage_anything_1/andso_on Here www.myexample.com is the web domain, mypage is the ...
Jones G's user avatar
  • 218
0 votes
1 answer
304 views

get_the_title() gets printed out twice

I made a script which checks if the currently viewed page has a parent page and if it does, it prints both the parent title and child title. But if there is no parent page I still get a title of the ...
Limpuls's user avatar
  • 307
0 votes
0 answers
32 views

Use page-templates without creating theme

I have created 7 pages that are used for CPT and other information. I want to know if there is a way to call the page templates without creating them. I just want a more tidy interface for the user, ...
Phaidonas Gialis's user avatar
1 vote
0 answers
46 views

My page.php shows the index.php

Sorry for this simple question, I am very new to Wordpress. I have a simple index.php that show a view of posts, just the images. When I click on any post, it should send me to the full view of ...
ValRob's user avatar
  • 113
1 vote
1 answer
921 views

Global variable $post returning incorrect object

In my header.php file, I've been trying to retrieve the slug of the current page, to check it's WooCommerce Products Archive/shop page. I followed this similar question's answer, to no avail; instead ...
dǝɥɔS ʇoıןןƎ's user avatar
0 votes
0 answers
506 views

Get current_post in reverse order with pagination

I'm trying to index my posts (in reverse) and I'm using current_count within loop to do this. This is my code: <?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args ...
Karadjordje's user avatar
1 vote
1 answer
746 views

How can I load a PHP page without using a Template?

I've been building out a website within a WordPress 'wrapper', and it's been going reasonably well. I've got a Plugin that holds some of my code, and I've got a Theme that holds other bits of my code,...
Kyle Humfeld's user avatar
0 votes
1 answer
2k views

Retrieve Json data and create multiple pages with it

I am trying to load json data from this url and i want to create a page for every single hero available in the json file.how should i retrieve this json file and distribute the content in multiple ...
Hamed's user avatar
  • 21
1 vote
1 answer
870 views

Can't load WP function into external function

I created a bookshop website and got header function, footer function and login menu on my front page. All functions are declared in functions.php and connected to hooks. My front page runs ...
adrian's user avatar
  • 11