How would I retrieve attachments from all subpages of a specific Page ID? Example: SPECIFIC PAGE Child (with attachments) Child (with attachments) Child (with attachments) I'm currently using this code to retrieve all attachments site-wide, however I would like to limit this to only pull images from all children of a specific Page. $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null ); $attachments = get_posts( $args ); if ( $attachments ) { foreach …
I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? PHP Source: $args = array( 'child_of' => $post->ID, 'parent ' => $post->ID, 'hierarchical' => 0, 'sort_column' => 'menu_order', 'sort_order' => 'asc' ); $mypages = get_pages( $args ); foreach( $mypages as $post ) { $post_tempalte = the_page_template_part(); get_template_part( 'content' , $post_tempalte ); } My $args should be correct according to the documentation, but it's totally ignoring parent …
I just recently updated my Wordpress, theme, and plugins, and am now getting these two errors on top of the homepage and pages page. Deprecated: wp_make_content_images_responsive is deprecated since version 5.5.0! Use wp_filter_content_tags() instead. in /var/www/html/wp-includes/functions.php on line 4773 and the pages page, Notice: register_rest_route was called incorrectly. The REST API route definition for pum/v1/analytics is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging …
I have a lot of Pages which can be (need to be) grouped under a number of different Categories. ** Then the more important thing is, i need to control those pages (of different groups) programatically via functions.php. Lets say, i would have: Page A (Categorized as: Fruits) Page B (Categorized as: Vehicles) Page C (Categorized as: Vehicles) Page D (Categorized as: Fruits) Page E (Categorized as: Technology) Then from functions.php, there would be some logics, like: If Page is …
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, "Portfolio". If I do something like: <?php $id="page-id-8229"; include '/modals/work/cplfModals.php';?> for each file in my Portfolio template, each page will still load all of the modals that are assigned, not just the one that I'm try to assign to that page. Is there …
I have a plugin installed, which is creating user profiles on frontend. The ID of this page is 301 in backend of wordpress. If a profile site is visited, i want to append the url with a parameter. The parameter value is stored in a cookie. The code for appending the URL is working, but when i add the code to only show on this page id its not working. The code is executed in my child themes functions.php NOT …
I use a Builder plugin on the site. Members are editors and can create their own page. I want to disable Gutenberg so that they can only edit pages with Buldir. I would also disable the properties of the page for them and I would enter it automatically. When I create a new page, I disable comments, the template is Blank Page, do not access the Custom fields. You can practically just add a featured image and title to your …
To make better looking category pages in my sites, I'm looking for a way to show the content of a regular page on the permalink /category/name. How can I achieve that ? Thanks
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 NOT show up in the all pages list. Also accessing their url give a 404. However, when you access the edit mode directly: https://xxxxxxx.nl/wp-admin/post.php?post=3280&action=edit&lang=nl The page 'comes to life' (even without saving) and is visible as sub-page in the 'all pages' page. Any …
Hi everyone I'm newbie in Wordpress coding so please guide me as a newbie.. I want to show Permanent word counter on Page Create. any help would be really appreciated thanks
I've got custom template that I want to display paged blog posts. This is the beginning of my file: $wp_query = new WP_Query($args); if($wp_query->have_posts()){ while($wp_query->have_posts()){ $wp_query->the_post(); //something... <?php next_posts_link('Older Entries'); ?> <?php previous_posts_link('Newer Entries'); ?> It works fine - it displays OLDER and NEWER links when it should. On the first page it will display only a link to older entires. On the second page both to newer entries and yet older ones etc. But I don't want to overwrite …
I am using the page links: https://codex.wordpress.org/Styling_Page-Links as: wp_link_pages(array('before'=>'', 'next_or_number'=>'next', 'previouspagelink' => '&laquo;', 'nextpagelink'=>'&raquo;')); I want to add an additional link, For eg: X, which upon clicking will take the user to the first section. Is it possible to achieve this using this function? Any help is much appreciated.
The users of my site mainly share documents by inserting links into content (pages/posts) using the built in editor. These files include everything from pdfs to word documents. The users currently get/copy these links from a php file manager like FileRun. My goal is to have the users instead use a path from mapped network drive such as \testdrive\Folder1\Folder2\test.txt. The following function has been written to handle replacing the mapped network drive files to an internet link such as "http://page.test.org/files/". …
Can I assign WP php file (specific template) to several pages with same prefix name/slug using (if is_page(){}) ? If it's possible it could be useful. Is there a php function to do like css selector : [class*="activity-"] for example ??: if(is_page('[activity-]')){ include "activity.php"; } the goal is to not repeat 4 times the same function : if(is_page('activity-sport')){ include "activity.php"; } activity.php assign to : website/activity-sport website/activity-culture website/activity-charity website/activity-work
i'm new to wordpress and i'm trying to create a website. i need display the content of the pages when corresponding menu items are clicked. my page.php contain <?php while ( have_posts() ) : the_post(); $page_data= $post->ID; if($page_data=='116') { ?> <center><b><h2>WELCOME TO THE CLINIC!!</h2></b></center> <?php } else{ ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php the_content(); } endwhile; ?> but my content is not displaying. title is showing properly. what is the mistake in the code? please help me.
I want to set up my site to have the following permalink structure: /learn/%category%/%postname% So in the permalinks section of wordpress, I set that as the custom structure. The issue is, when I click on a category page it's just: /%category%/ (it's ends up being a /category/subcategory/ url). So I tried setting the category base on the permalinks setting page also to /learn/, but then I get a 404 when I go to a post's page. How do I make …
I'm trying to add Next and Previous links to my site Pages (not Posts) to navigate based on the 'Order' information. I copied some code from the Codex (https://codex.wordpress.org/Next_and_Previous_Links) that works fine (displays the pages in the right order - not cronological) except on the first and last pages where I get an error. The error shows "Undefined array key" where the Previous link on the first page should be and the same error (different array entry) where the Next …
I am running into a new issue where when I attempt to create a new page, the permalink is not being auto generated. For instance On the 'Add New Page' page, I select 'Our Club' as the parent (which has a slug of 'club'). I then type in 'Membership' as the title. However, the permalink that is generated below the text input says www.coolclub.com/membership (instead of www.coolclub.com/club/membership as expected). If, instead of select 'Clubhouse' as the parent of my new …
I have a website with over 500 pages. Dont ask why but none of these pages have any content in them. I have created a page layout to be added as a single wp bakery block and want to add this same block to all pages but I cant see a way of doing this without going through everypage and doing it manually. Am I missing something?