Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8368675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:26:36+00:00 2026-06-09T13:26:36+00:00

I created a config.php file that defines the URL for the site, I also

  • 0

I created a config.php file that defines the URL for the site, I also created a variable for the template URL “/_inc” both using DEFINE. I call these variables in functions.php successfully, I then created a function to display the URL, I include the functions.php file into my header.php and then include that elswhere.

Everything works fine but I am trying to use the function in an if statement to add a current_page_item class to nav links. I am currently using the following code which is not working because I have it coded incorrectly. I need to know the correct coding procedure.

<?php if(site_url(). '/index.php') { echo 'current_page_item'; } ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:26:38+00:00Added an answer on June 9, 2026 at 1:26 pm

    I was also declaring variables while including the header.php. I used the following code to fix this problem.

    <?php if($get_page_name == 'Home') echo 'current_page_item'; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a config.php file that creates an array, something like $config = array(
I have created a config file that looks like: $conf['db_hostname'] = localhost; $conf['db_username'] =
I have an app.Config that was created on the dev machine running Windows 7.
I have created a library which reads the app.config file and gets the type
I am using the Visual Studio 2005, and i created one application with App.config
Is it possible to create a custom configuration file (other than app.config) that can
I am new to Codeigniter and using Codeigniter 1.7, I created a .htaccess file
I am trying to edit my config/database.php within my CodeIgniter project so that I
I'm having a bit of trouble exporting a csv file that is created from
I have following in my config.php file for one of my web app. //db

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.