List pages including both parent and child pages

I don’t think there is a way to express that precisely in its arguments. You could work around that by building array of page IDs which includes parent and children set as desired. $pages = get_posts( [ ‘post_parent’ => $page_id, ‘post_type’ => ‘page’, ‘fields’ => ‘ids’, ] ); $pages[] = $page_id; wp_list_pages( [ ‘include’ => … Read more

Navigate to external link if last page or post in a category

Since it’s not clear exactly what you need it’s hard to give you the best solution. However … You should be able to use get_next_posts_link() in your loop template. Or get_previous_posts_link() if that’s what you want. If that returns null you can then echo a link to whereever you want in your template. if(!get_next_posts_link()) { … Read more

changing static link to relative link

If I’m understanding your question correctly, you want links on your site to dynamically change depending on the domain name of the environment you’re in? To do this you can replace any hard coded links with the home_url() function. So you would change references to links from http://192.168.0.1/your/path/here to <?php home_url(/your/path/here); ?> If your links … Read more

Add a data attribute to list item element in menu

try this code in your functions file. function add_class_to_nav_items($nav_items, $args) { if ( $args[‘theme_location’] == ‘MY_NAV_THEME_LOCATION’ ) { // IMPORTANT: replace MY_NAV_THEME_LOCATION with the location of your menu foreach ($nav_items as &$nav_item) { $nav_item->classes[] = ‘custon-class-name’; } } return $nav_items; } add_filter( ‘wp_nav_menu_objects’, ‘add_class_to_nav_items’, 11 );

WordPress Intranet Link Not Working

I think it’ll be messy. You’ll need browser extensions or per-browser settings, because you’re basically asking the browser to access a file:// link which is not local to the machine, and I think many modern browsers have locked that down for security reasons. Sorry I can’t be the bearer of better news. 🙂

Let WordPress to go opening an external URL

You forgot to add the “http” to the url Try please this: $link = “<a href=”http://”https://wordpress.stackexchange.com/questions/254153/. $_COOKIE[“link’] .”‘>TEXT SHOWN</a>”; You also can adjust and add the http:// to the $_COOKIE itself. If you want that the new link will open in a new tab, add target=”_blank” like so: $link = “<a href=”http://”https://wordpress.stackexchange.com/questions/254153/. $_COOKIE[“link’] .”‘ target=”_blank”>TEXT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)