You can try this.
<?php
if ( is_single() )
the_content();
else
custom_excerpt('custom_index');
?>
in your post loop.It prints content if the post is single.php page otherwise custom_excerpt() data.
Related Posts:
- Sending the reset password link programatically
- Display all values of custom a field created with ACF on a page
- How to change upload directory in wp_handle_upload
- How do I directly access a PHP file located in my themes folder?
- wpdb::prepare was called incorrectly
- Only show div on homepage/blog index in wordpress/php
- WordPress the_content() return only one image from a specific category
- Calculate percentage of post by category
- count number of user comments with a specific comment meta value
- Display all posts in current category
- file_exists() acting weird
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- Is it possible to use the featured image of a page as a css background without inlining?
- PHP syntax error when using wpdb update?
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Warning: array_pop() expects parameter 1 to be array, boolean given
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- items_wrap not working
- Can is_page() be combined with a switch control structure?
- Shortcode API: How to get name that matched shortcode RegEx?
- Using shipped version of jquery
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- Can’t search posts using WP_QUERY inside AJAX Function
- How do I Add HTML to the_excerpt() & the_content() Output?
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- User’s total comment count excluding comments on their own posts
- Is there a way to programmatically create multiple pages utilizing the same template but different content from a json file?
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- do search in two site and show the result in first site
- What’s the uses of wp_cache_set() or wp_cache_add()?
- How to get post’s current parent term ID?
- Adding Taxonomy Image to taxonomy loop [closed]
- Use of wp_insert_post and parameters
- WordPress theme options error
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- get_the_title() gets printed out twice
- Moving code from theme header to functions.php
- What does this mean in wordpress? Easy question
- How to get private property in parent class into extended class?
- Woocommerce Email attachments not working – file not being attached
- Best way to use a large array in function
- AJAX button action in foreach
- Add Codepen animation as Preloader to WordPress
- Setting user nickname and displayname to shortened email
- Error Uncaught ArgumentCountError i cant find it
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- WordPress wp-admin redirect and exception
- Use $wpdb or other PHP script method to find/replace in WP database
- Simple WordPress endpoint route doesn’t work
- Validate and Sanitize WP REST API Request using WP JSON Schema?
- How do I create a function that modifies a message in the wp-login.php file?
- HTML dropdown setting not showing last saved value in the database
- export a mysql table to csv with column headers
- Reusable code that I can store in the function.php and apply to other templates as need. Dry Code
- Getting the slug into a variable, how to echo that variable
- Post meta select input, if statement
- Create Columns with Custom Walker and CSS Classes
- Set document title through shortcode plugin
- WordPress url By country code?
- How to change basename url for wp-admin?
- current_time function incorrect in plugin and PHP, not in WordPress admin
- Implementing a multilingual WordPress site by installing several instances of WordPress and redirecting
- Weird fonts showing which are coming from database
- WordPress all php BUT index.php downloads instead of loads
- Don’t update modified post date when user add a product review or comment?
- Mysterious letters appearing at the top of a few pages
- Trouble matching strings (titles) using wp_query
- Current WordPress Page Title as Search Parameter into A Tag
- Using Javascript On Page – Header and Footer Now Missing
- wp_remote_request to url with port 8001 not woorking
- Customizer textarea with script tag won’t work in live preview
- How to give custom roles the capability to edit one Menu instead of every Menu
- Unzip_file causing Media file upload error
- Styling a specific post after hovering over it
- WordPress file upload
- Escaping a Single Quote in str_replace for Nav Function
- PHP tag in post content makes wordpress go crazy
- How can I turn a url with get method as a clean url with segment as the get method?
- insert thumbnail image from php script
- widget: input the px value from user and use it as inline style in widget function
- How to call a certain object/menubar in a PHP file
- Setting pages for posts
- Problems with plugin that fetches data from database with ajax
- Trying to see if page is category or single and displaying title with appropriate heading tag
- Get null from POST
- How to have post count after each listed category
- why is markup routinely placed in functions in wordpress?
- Customise Author Page?
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Difference between php memory limit and wp memory limit?
- Login user into magento using wordpress account
- save array of objects with update_option
- What is the best way to reset the site? Different fails while set up
- Use of undefined constant issue
- Themeco Looper Provider Query String for current user posts [closed]