Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

is_single returns true for attachment page (navigation.php) #871

Closed
mrsWeasel opened this issue Aug 19, 2016 · 2 comments
Closed

is_single returns true for attachment page (navigation.php) #871

mrsWeasel opened this issue Aug 19, 2016 · 2 comments

Comments

@mrsWeasel
Copy link
Contributor

Just added an image gallery with the option to link to attachment page. When I clicked the image link, these are the error messages i got in debug mode:

Notice: Undefined offset: 0 in .../navigation.php.
Notice: Trying to get property of non-object in .../navigation.php.

The problem seems to be the conditional block in foundationpress_breadcrumb function. Quick fix (although I'm sure there are better ones) that seemed to work was to make sure that attachment page does not return true for is_single:

if ( is_single() && ! is_attachment() ) {
// echo the stuff
}

OS & version: MacOS 10.8.5
Node version: 5.0.0
Foundation version (bower list) : 6.2.0

PS I'm a total newbie with Github so apologies if this didn't go 100% by the book :)

@colin-marshall
Copy link
Collaborator

@mrsWeasel thanks for pointing this out. Would you like to submit a pull request with the bugfix? I can walk you through it.

@mrsWeasel
Copy link
Contributor Author

@colin-marshall sure I'd love to! How should we go about this?

mrsWeasel added a commit to mrsWeasel/FoundationPress that referenced this issue Oct 27, 2016
See issue olefredrik#871 (is_single returns true for attachment page (navigation.php))
NestedDEV added a commit to NestedDEV/FoundationPress that referenced this issue Aug 10, 2017
* Update package.json

* Update gulpfile.js

* Update gulp config to use gulp-clean-css. [gulp-minify-css depracated]

* Bugfix for figuretag

Wordpress adds a with attribute to every figure tag, breaking the whole
layout.

* match coding guidelines for figure tag fix

* match coding guidelines part 2

* add_filter method moved into foundationpress_start_cleanup

* whitespace removed

* added hebrew translations

* added hebrew translations & translator details

* Fix WP coding standards violations

* Whitespace removed at the end of line

* Add an .editorconfig file

To prevent mixing spaces and tabs. Inspired by WordPress Core .editorconfig and standardjs.com

* Remove executable permissions for files

This oneliner was used for clearing the execute bits:
`find . -type f -perm +111 -exec chmod a-x {} \;`

* Updated README.md with info on packaging the theme to a zip file

* Added missing space before opening curly brace on Foundationpress_Comments class

* Add missing comment on variable

* Add space after opening brace

* Fix broken link

* Update changelog

* Update cs_CZ.po

* Use System UI fonts

* Update changelog

* tr language file added

* Normalized SCSS indentation to match Foundation

* Normalized SCSS comments to match Foundation

* Normalized SCSS code block grouping

* Normalized PHP class name 'Foundationpress_Protocol_Relative_Theme_Assets'

* Added 'End if()' comments for long conditionals.

* Typo in dropdown font size setting

16rem font size in dropdown menu is HUGE.

* Add Danish language

* Fix issue with 'Posted on'

* Update codesniffer ruleset

* Fix 'Posted on ...' for all languages

And validation error in fi.po.

* Add Interchange on featured images
-

* Solved problems

* Solved problems

* Update showcase sites

* Reformat code to fit WP PHPCS standards

Fairly minor changes here, consisting of moving == intances to
=== and moving else if instances to elseif. In a few places, I've
moved the if/elseif control structure to the alternate syntax due
to the presence of HTML as well.

This is all to fix the errors PHPCS were throwing when ran.

* Update featured image Interchange queries

Removed 'default' named media query which
does not exist in Foundation 6.

http://foundation.zurb.com/sites/docs/interchange.html#named-media-queries

* Removed unused Interchange variables

These variables were added in a previous commit
but never referenced in any code.

795804a

* Update namespace for 'image_size_names_choose' filter

* Change order of 'image_size_names_choose' filter

* Optimized featured images

Added new image sizes specifically for featured
images that are optimized for landscape aspect
ratio and updated SCSS for new ratio as well.

* Make single post featured image layout match pages

Previously the 'single.php' template had the featured
image inserted inline as an image tag. Now it shares
the same layout used for pages by including
'template-parts/featured-image.php'.

* Update changelog

* Update navigation.php

See issue olefredrik#871 (is_single returns true for attachment page (navigation.php))

* Order placeholders

* Added XLarge

* Update version number

* Update description on node versions in readme

* Migrate to Foundation v6.3.0

* Add cards example to kitchen sink template

* Update version number

* Tweak the off-canvas component

* Remove my localhost URL from the gulpfile

* Invalidate the cache for new version

* Use smaller placeholder img in kitchen-sink template for better perf

* Update changelog

* Remove Motion UI and What Input from Gulp Copy task.

* Remove motionUi and whatInput from merge-stream.

* Remove to-be deprecated classes from flex-video example

"flex-video" classes will be deprecated in favour of the "responsive-embed" class. Also -- there is no longer any Vimeo-specific class within F6. Something like the proposed would be a more future-proof starting point for responsive videos.

* Update showcase and UI toolkits

* Fix responsive accordion tabs

* Remove local server url from gulpfile

* update bower version

fixes errors related to `internal/fs`

* Solve/Avoid JS Conflict by Replacing '$' to 'jQuery'

* Deleted Empty File 'offCanvas.js'

It was added in commit 1ec0f4b

* Fix Mobile Menu Button AKA Hamburger

The mobile menu button broke in FoundationPress when using Foundation 6.3.1. The problem is the 'title-bar' needs to have the 'data-responsive-toggle' set to the same ID as the button 'data-toggle' value.

* Fix Travis CI Build Errors

Errors are from recent updates to WordPress Coding Standards. Majority of the errors are related to missing translation comments for placeholders such as '%s'.

* Fixed More Travis CI Build Errors

* One More Travis Fix

* Delete Joyride Demo JS

Joyride is not included in Foundation 6.

* Replace Responsive Video JS with WP Filter

Better to handle in the backend instead of the frontend. Also, adds support for additional video sites supported by WP embeds and dynamically adds class 'widescreen' to 16:9 videos.

* Optimize Sticky Footer JS

Wrap in immediately-invoked function expression to create variable scope. This also allows the use of '$' in place of 'jQuery' without conflicts with other scripts.

* Minor Video Embed Optimization

Break loop after finding first match in whitelist.

* Improve Video Embed Comments

* Update PHP versions to use in Travis CI Build Checks

* Add PHP 5.6 and Nightly to Travis CI

* Update changelog

* Update version number to 2.9.2

* Changed search template to match default page mark up
Removed hard coded css classes 'small-12 large-8 columns' which are a legacy feature from older versions.

Using the 'main-content' css class the page inherits the same behaviour as the default page.

Changed page header to h1 and placed inside a header tag similar to 'page.php'.

The purpose of these changes was to have the search page follow the same behaviour as the other pages in the template.

* Changed id attribute on article tag to 'search-results'

* Update font-awesome to v4.7.0

* fix hard-coded height of menu items

* Removed broken links

* Update Pagination Centered

* Fix Off-Canvas Menu Bug

Fixed bug which prevented off-canvas menu from displaying on every other toggle. This had to do with a conflict with the Responsive Navigation's Responsive Toggle feature. Solution is to have a unique ID for both the top bar and off-canvas menus.

* Remove Off-Canvas Cruft

Pre Foundation 6.3 off-canvas cruft is no longer needed.

* Dynamically Add Responsive Toggle Attr

Responsive toggle attribute is only needed for mobile menu layout 'topbar'.

* Sync Sass Settings with Foundation Defaults

* Simplify Navigation Sass and HTML

Removed unnecessary styling that deviates from vanilla Foundation. Added new classes to use as selectors in place of Foundation component classes. This prevents additional Foundation components like the Top Bar from being affected by the unique navigation styling. Updated HMTL for Title Bar and Top Bar components to match the Docs for the title.

* Fix Category page breadcrumb

Fixed breadcrumb in Category page.
Changed it from the first term in $category to the current category.

* Replace CSS ID Selectors with Classes

Where appropriate, ID selectors have been replaced with classes to reduce specificity. A big offender were the individual templates, which used IDs to determine column layouts. Now they all share the same class '.main-wrap' for the basic column styling and make use of helper classes for variations like .

* Cleanup Template Indentation

Also update '404.php' markup to use the new class based content layout.

* Fix Kitchen Sink Header

* Kitchen Sink Updated
Added missing class colors to buttons and callouts

* Fix WPCS by Downgrading PHPCS to v2.9

WordPress Coding Standards is not compatible with latest version of PHPCS v 3.0. See WordPress/WordPress-Coding-Standards#947

* Fixed All WPCS Errors

* Sync with Master Breadcrumb

* Remove search query from current breadcrumb class

Using the raw search terms as a class, despite being escaped, is a bad idea. Depending on which search terms are being used, these may potentially include existing class keywords which can cause style/layout issues on the page.

* Fixed Edit link

Fixed small typo in Edit link in Page and Single that prevent
traduction to work

* Make nav menu names translatable

* CPT Archive Support for FoundationPress Breadcrumb

On Custom Post Type Archives the breadcrumb currently shows only the "home page".
This additional code will add the custom post type name as current menu item.

* Add taxonomies support to breadcrumbs

* Add template and settings for demosite

* Add new site to showcase

* Update gulp-sass

* Update gulp-clean-css

* Remove Travis-CI

* Remove phpcbf and phpcs deps

* Remove phpcbf and phpcs tasks

* Remove my localhost from gulpfile

* Update gulp-sourcemaps to latest version

* Update changelog after publishing new release

* Bump version number to 2.9.3

* Update Foundation to version 6.4.1

* Use semantic xy-grid in front template

* Use semantic xy-grid for content module

* Use semantic xy-grid in footer

* Use semantic xy-grid in kitchen sink template

* Update inclusion and usage of dependencies

* Introduce webpack and restructure assets

* Follow up on previous commit

* Load app.js just before the closing body tag

* Configure browsersync with proxy

* Remove the off-canvas-wrapper as this is no longer required

* Set navigation colors

* Update gitignore

* Remove dist folder as this should be ignored by git

* Set path to dist folder for demo images in front template

* Update README

* Add more descriptions to README file

* Fix for issue olefredrik#991 WooCommerce 3.0+ Compatibility

changed 'remove_thumbnail_dimensions' function in library/responsive-image.php to check if the image is being added to a woocommerce page before removing dimensions.

* Add .idea folder created by PHPStorm to list of ignored list

added folder .idea which is created by phpstorm IDE

* Update Adibe in Kitchen Sink template

* Update README

* Add watch task for PHP files

* Use XY-grid on cards example in Kitchen Sink

* Remove float classes due to deprecation notice in Foundation Docs

* Add equalizer to Kitchen Sink

* Adjust gutters on card example in Kitchen Sink

* Tweak submit button markup in forms section in Kitchen Sink

* Use is-active instead of active for menu active state

* Fix indentation of tabs in Kitchen Sink

* Remove browsersync port, as we're using proxy instead of server

* Update README

* Set the same bg-color on dropdown-menu as topbar-menu

* Set primary bg-color on sites-button

* Enqueue FontAwesome from CDN

* Remove FontAwesome files

* Add demosite script

* Fix formatting issue in README

* Edit README

* Remove my localhost from the URL variable in Gulpfile

* Update changelog

* Use XY-Grid in footer

* Bump version number

* Update changelog

* Remove UnCSS as it's designed to work with static HTML files

* Update issue template

* Add fontawesome handle

* Include only XY-grid and disable float-grid by default

* Fix active menu item function, so is-active class is added correctly

* Fix typo in comments

* Bump version number and update changelog

* dequeue FontAwesome CDN

commented out FontAwesome CDN enqueue line. Enabling given over to developer's preference or need
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants